Attempts were made from the late 1st century to the late 3rd century to establish the church in the Iberian peninsula. Canons of the Synod of Elvira (circa 305 AD) indicate that the church was greatly isolated from the general population even at that time. The situation of the Christians in Iberia improved with the advent of the Edict of Milan in 313 AD, after which Christians were more or less free to practice their religion openly within the Roman Empire. Over the course of the 4th century, the church built significant footholds particularly around Seville, Cordoba and Toledo.
As Rome declined, Germanic tribes invaded most of the lands of the former empire. In the years following 410 Spain was taken over by the Visigoths who had been converted to Arian Christianity around 419. The Visigothic Kingdom established their capital in Toledo, their kingdom reaching its high point during the reign of Leovigild. Visigoth rule led to the expansion of Arianism in Spain. In 587, Reccared, the Visigothic king at Toledo, was converted to Catholicism and launched a movement to unify doctrine. The Council of Lerida in 546 constrained the clergy and extended the power of law over them under the blessings of Rome.
About thirty synods, variously counted, were held at Toledo in what would come to be part of Spain. The earliest, directed against Priscillianism, assembled in 400. The "third" synod of 589 marked the epoch-making conversion of King Reccared from Arianism to orthodox Catholicism. The "fourth", in 633, probably under the presidency of the noted Isidore of Seville, regulated many matters of discipline, decreed uniformity of liturgy throughout the kingdom. The British Celts of Galicia accepted the Latin rite and stringent measures were adopted against baptized Jews who had relapsed into their former faith. The "twelfth" council in 681 assured to the archbishop of Toledo the primacy of Hispania (present Iberian Peninsula). As nearly one hundred early canons of Toledo found a place in the Decretum Gratiani, they exerted an important influence on the development of ecclesiastical law.
The seventh century is sometimes called, by Spanish historians, the Siglo de Concilios, or "Century of Councils".
By 689 Arabs and Berbers conquest Melilla, and by 709 the already then Visigothic Spanish city of Ceuta was taken.
By 711 Islam dominated all the north of Africa. The process of islamization of the Berber tribes had already begun, though most of the population was still Christian, Jew or polytheist. A raiding party recruited mostly amongst these newly subjugated, still non-Muslim Berbers and led by convert Tariq ibn-Ziyad was sent to plunder the south of the Visigothic Kingdom of Spain, which faced strong internal tensions and was at the verge of a civil war between the Chindasvintan, Witizan and nobiliary parties. Crossing the Strait of Gibraltar, it won a decisive victory in the summer of 711 when the Visigothic king Roderic was betrayed by the Witizan wings of his army and killed on July 19 at the Battle of Guadalete. Roderic's body was never found and lots of rumors about his fate arose, which led to a paralysis on the Visigothic command. Tariq's commander, Musa bin Nusair quickly crossed with substantial Muslim reinforcements from the Caliphal garrison of North Africa, and by 718 the Muslims dominated most of the peninsula. The advance into Europe was stopped by the Franks under Charles Martel at the Battle of Tours in 732.
The rulers of Al-Andalus were granted the rank of Emir by the Umayyad Caliph Al-Walid I in Damascus. After the Umayyads were overthrown by the Abbasids, some of their remaining leaders escaped to Spain under the leadership of Abd-ar-rahman I who challenged the Abbasids by declaring Córdoba an independent emirate. Al-Andalus was rife with internal conflict between the Arab Umayyad rulers, the north-African Berbers who had formed the bulk of the invasion force, and the Visigoth-Roman Christian population that was majoritary for almost the next four centuries.
In the 10th century Abd-ar-rahman III declared the Caliphate of Córdoba, effectively breaking all ties with the Egyptian and Syrian caliphs. The Caliphate was mostly concerned with maintaining its power base in North Africa, but these possessions eventually dwindled to the Ceuta province. Meanwhile, a slow but steady migration of Christian subjects to the northern kingdoms was slowly increasing the power of the northern kingdoms.
Al-Andalus coincided with La Convivencia, an era of religious tolerance (as far as Christians and Jews peacefully accept submission to Muslims, as well as being reduced to the condition of tax-paying serfs) and with the Golden age of Jewish culture in the Iberian Peninsula (912, the rule of Abd-ar-Rahman III - 1066, Granada massacre).
Medieval Spain was the scene of almost constant warfare between Muslims and Christians. The Almohads, who had taken control of the Almoravids' Maghribi and Andalusian territories by 1147, far surpassed the Almoravides in fundamentalist outlook, and they treated the dhimmis harshly. Faced with the choice of death, conversion, or emigration, many Jews and Christians left.
In the High Middle Ages, the fight against the Moors in the Iberian Peninsula became linked to the fight of the whole of Christendom. The Reconquista was originally a mere war of conquest. It only later underwent a significant shift in meaning toward a religiously justified war of liberation (see the Augustinian concept of a Just War). The papacy and the influential Abbey of Cluny in Burgundy not only justified the anti-Islamic acts of war but actively encouraged Christian knights to seek armed confrontation with Moorish "infidels" instead of with each other. From the 11th century onwards indulgences were granted: In 1064 Pope Alexander II promised the participants of an expedition against Barbastro a collective indulgence 30 years before Pope Urban II called the First Crusade. Not until 1095 and the Council of Clermont did the Reconquista amalgamate the conflicting concepts of a peaceful pilgrimage and armed knight-errantry.
But the papacy left no doubt about the heavenly reward for knights fighting for Christ (militia Christi): in a letter, Urban II tried to persuade the reconquistadores fighting at Tarragona to stay in the Peninsula and not to join the armed pilgrimage to conquer Jerusalem since their contribution for Christianity was equally important. The pope promised them the same rewarding indulgence that awaited the first crusaders.
After centuries of the Reconquista, in which Christian Spaniards fought to drive out the Moors, the Spanish Inquisition was established in 1478 by Catholic Monarchs Ferdinand II of Aragon and Isabella I of Castile, to complete the religious purification of the Iberian Peninsula.
It was intended to maintain Catholic orthodoxy in their kingdoms, and to replace the medieval inquisition which had been under papal control. The new body was under the direct control of the Spanish monarchy.
The Inquisition, as an ecclesiastical tribunal, had jurisdiction only over baptized Christians, some of whom also practised other forms of faith and at the time were considered heretics according to the Catholic Church and recently formed kingdoms at the time. The Inquisition worked in large part to ensure the orthodoxy of recent converts.
In the centuries that followed Spain saw itself as the bulwark of Catholicism and doctrinal purity.
On 31 March 1492, the joint Catholic Monarchs of Spain (Isabella I of Castile and Ferdinand II of Aragon) issued the Alhambra decree, accusing Jews of trying "to subvert their holy Catholic faith and try to draw faithful Christians away from their beliefs" and ordering the expulsion of Jews from the Kingdom of Spain and its territories and possessions by 31 July of that year.
Some Jews were given only four months and ordered to leave the kingdom or convert to Christianity. Under the edict, Jews were promised royal "protection and security" for the effective three-month window before the deadline. They were permitted to take their belongings with them - except "gold or silver or minted money".
The punishment for any Jew who did not leave or convert by the deadline was death. The punishment for a non-Jew who sheltered or hid Jews was the confiscation of all belongings and hereditary privileges.
As a result of this expulsion, Spanish Jews dispersed throughout the region of North Africa known as the Maghreb. They also fled to south-eastern Europe where they were granted safety in the Ottoman Empire and formed flourishing local Jewish communities, the largest being those of Thessaloniki and Sarajevo. In those regions, they often intermingled with the already existing Mizrachi (Eastern Jewish) communities.
Scholars disagree about how many Jews left Spain as a result of the decree; the numbers vary between 130,000 and 800,000. Other Spanish Jews (estimates range between 50,000 and 70,000) chose in the face of the Edict to convert to Christianity and thereby escape expulsion. Their conversion served as poor protection from church hostility after the Spanish Inquisition came into full effect; persecution and expulsion were common.
Many of these "New Christians" were eventually forced to either leave the countries or intermarry with the local populace by the dual Inquisitions of Portugal and Spain. Many settled in North Africa or elsewhere in Europe, most notably in the Netherlands and England.
Spanish missionaries carried Catholicism to the New World and the Philippines, establishing various missions in the newly colonized lands. The missions served as a base for both administering colonies as well as spreading Christianity.
However, the Spanish kings insisted on these missions maintaining independence from papal "interference"; bishops in Spanish domains were forbidden to report to the Pope except through the Spanish crown.
Philip II became king on Charles V's abdication in 1556. Spain largely escaped the religious conflicts that were raging throughout the rest of Europe, and remained firmly Roman Catholic. Philip saw himself as a champion of Catholicism, both against the Ottoman Turks and the heretics.
The synod of 1565-1566 held in Toledo was concerned with the execution of the decrees of Trent. The last council of Toledo, that of 1582 and 1583, was so guided in detail by Philip II that the pope ordered the name of the royal commissioner to be expunged from the acts.
In the 1560s, Philip's plans to consolidate control of the Netherlands led to unrest, which gradually led to the Calvinist leadership of the revolt and the Eighty Years' War. Spain retained control of the southern regions (modern-day Belgium) as the Protestants there fled north to The Netherlands.
In the 16th century the first Spanish missionaries emerged, especially in America and Asia. Examples of this are the Jesuits Saint Francisco Javier (the so-called "apostle of India" who evangelized India, China and Japan) and Saint José de Anchieta ("apostle of Brazil"), the Franciscans Saint Junípero Serra (apostle of California) and Saint Peter of Saint Joseph de Betancur ("apostle of Guatemala"), or the Dominican Thomas of Zumárraga (missionary in Japan), among many others.
The Counter Reformation was the effort of the Catholic Church to reform itself, rebuild its base of support, and fight off the Protestant threat. It was highly successful in Spain. John of Ávila (1499-1569) provided the Counter-Reformation with some of its most powerful strategies for social control. His writings on educational theory and practice involved a flexible strategy that focused on moral formation rather than the coercive regulation of behavior. He strongly supported the new Jesuit order. He helped rally support for the decrees of the Council of Trent, particularly those regarding the establishment of diocesan seminaries.
The characteristic Spanish religiosity at this time was expressed through mysticism. It was the means by which the intensely devout could move beyond the routine of good works and standard prayers to have a direct encounter with God. The outstanding exponent of mysticism was Teresa of Ávila (1515-1582), a Carmelite nun who was active in many different modes of religion, including organizing convents and new congregations, and developing the theology of the Counter Reformation in Spain that permanently minimized the Protestant influence there.
In the 1620s Spain debated who should be the nation's patron saint- the current patron Saint James Matamoros (Saint James the Moor-slayer) or a combination of him and the newly canonized Saint Teresa of Ávila. Teresa's promoters said Spain faced new challenges, especially the threat of Protestantism, and the declining society at home and needed a modern patron saint who understood these problems and could lead the Spanish nation back. Santiago's supporters ("santiaguistas") fought back viciously and won the day, but Teresa of Avila remained far more popular at the local level.
Philip III (1598-1621) and Philip IV (1621-65) launched a new policy of appointing priests from religious orders to the more prestigious dioceses. The Dominicans had an advantage in the competition for office, as they influential high court positions such as royal confessor. There was an unexpected result in that bishops who were members of religious orders were more inclined to protest the growing royal taxation of the Church.
The Catholic Church was the most powerful and closest ally of the government. It helped fund the government, giving it over 20% of its large income from tithes. The royal policy was to have complete control over the personnel of the church, such as the selection of bishops, abbeys, and other major officeholders. After Spain spent 2.5 million pesos in payoffs and bribes, the Pope went along with the extension of Royal control in a concordat agreed in Rome in 1753. A serious issue arose regarding the Jesuits, who had links to powerful nobles but were distrusted by the other orders such as the Dominicans and Augustinians. and owed their loyalty primarily to the Pope, rather than to the king. The solution was to expel all 5000 Jesuits from Spain and its overseas empire, which was done expeditiously in 1767-68.
The correspondence of Bernardo Tanucci, the anti-clerical minister of Charles III in Naples contains all the ideas which from time to time guided Spanish policy. Charles conducted his government through Count Aranda, a reader of Voltaire, and other liberals. At a council meeting of January 29, 1767, the expulsion of the Society of Jesus was settled. Secret orders were sent to the magistrates of every town where a Jesuit resided. The plan worked smoothly and all the Jesuits were marched like convicts to the coast, where they were deported to the Papal States. By 1768 the Jesuits had been dispossessed throughout the Spanish dominions.
The impact on the Spanish New World was particularly great, as the far-flung settlements were often dominated by missions. Almost overnight in the mission towns of Sonora and Arizona, the "black robes" (as the Jesuits were known) disappeared and the "gray robes" (Franciscans) replaced them.
Secular and anti-clerical forces grew steadily stronger in the 19th century. Spiritists (spiritualists) emerged and forged a political identity. Bishops said their belief in direct communications with the dead was heresy. The spiritists had a middle class profile, were concerned with Spain's moral regeneration, and embraced rationalism, and a demand for Catholic reform. These views brought them in contact with other dissident groups and they all entered into the political arena when the Restoration-era Church refused to tolerate their "heresies". Debates over the secularization of cemeteries in particular granted spiritists a degree of public legitimacy and brought them into the circle of freethinkers who embraced republicanism.
The first instance of anti-clerical violence due to political conflict in the 19th century occurred during the First Spanish Civil War (1820-23). During riots in Catalunya 20 clergymen were killed by members of the liberal movement in retaliation for the Church's siding with absolutist supporters of Ferdinand VII.
The Inquisition was finally abolished in the 1830s, but even after that religious freedom was denied in practice, if not in theory.
Catholicism became the state religion when the Spanish government signed the Concordat of 1851 with the Vatican. " The 1851 concordat had Catholicism as ' the only religion of the Spanish nation' but by ratifying the status quo, including disentail [desamortización or sale of entailed lands created a free market in land], the concordat itself represented an accommodation with the liberal state. The experience of disentail had, however, replaced the Church's assumption of privilege with a sense of uncertainty. Though it would be many years before it ceased to look to the state for protection and support - not least in denying freedom of worship to Spaniards until 1931 - the Spanish Church now accepted the secular jurisdiction of the state and some idea of national sovereignty." 
In the late nineteenth century the Catholic Church maintained its base among the peasants in most of Spain, but also enjoyed a revival in upper-class society, with aristocratic women taking the lead. They formed a numerous devotional and charitable organizations and fought against prostitution; they tried to freeze anti-clerical politicians out of high society. Anti-clerical activists, union members, and intellectuals were increasingly annoyed by the reinvigoration of the church at the upper levels of society.
The Republican government which came to power in Spain in 1931 was strongly anti-clerical, secularising education, prohibiting religious education in the schools, and expelling the Jesuits from the country. In May, 1931, a wave of attacks hit Church properties in Madrid, Andalucia, and the Levant, as dozens of religious buildings, including churches, friaries, convents, and schools, lay in ruins. The government expropriated all Church properties, such as episcopal residences, parish houses, seminaries and monasteries. The Church had to pay rent and taxes in order to continuously use these properties. Religious vestments, chalices, statues, paintings, and similar objects necessary for worship were expropriated as well.
The Church was weak among the anti-clerical middle-class and much of the urban working class, but remained powerful among the wealthy elite and the Army. Its main base was the peasantry in heavily rural Spain. It had international support from Catholics, especially members of the Irish diaspora, which was politically powerful in the United States. There were some middle class Catholics, and their women were mobilized through the Acción Católica de la Mujer [Women's Catholic Action], established in 1920. It emphasized women's role as mothers and caregivers and register women by presenting the vote as a means to fulfill women's obligation to protect family and religious values.
Political ideologies were intensely polarized, as both right and left saw vast evil conspiracies on the other side that had to be stopped. The central issue was the role of the Catholic Church, which the left saw as the major enemy of modernity and the Spanish people, and the right saw as the invaluable protector of Spanish values. Power see-sawed back and forth, 1931-36 as the monarchy was overthrown, and complex coalitions formed and fell apart. The end came in a devastating civil war, 1936-39, which was won by the conservative, pro-Church, Army-backed "Nationalist" forces supported by Nazi Germany and Italy. The Nationalists, led by General Francisco Franco, defeated the Republican "Loyalist" coalition of liberals, socialists, anarchists, and communists, which was backed by the Soviet Union.
Thousands of churches were destroyed, and Catholic priests, nuns and conspicuous laymen came under violent attack by the Republican side. Of the 30,000 priests and monks in Spain in 1936, 6800 were killed, including 13% of the secular priests and 23% of the monks. 13 bishops and 283 nuns were killed. Half the killings took place during the first month and a half of the civil war. The killers were typically anarchists who acted because the Church was their great enemy and it supported the rebellion.
In the early years of the Franco regime, church and state had a close and mutually beneficial association. The loyalty of the Roman Catholic Church to the Francoist state lent legitimacy to the dictatorship, which in turn restored and enhanced the church's traditional privileges.
Franco's political system was virtually the antithesis of the final government of the republican era--the Popular Front government. In contrast to the anticlericalism of the Popular Front, the Francoist regime established policies that were highly favorable to the Catholic Church, which was restored to its previous status as the official religion of Spain. In addition to receiving government subsidies, the church regained its dominant position in the education system, and laws conformed to Catholic dogma.
During the Franco years, Roman Catholicism was the only religion to have legal status; other worship services could not be advertised, and only the Roman Catholic Church could own property or publish books. The government not only paid priests' salaries and subsidized the church, but it also assisted in the reconstruction of church buildings damaged by the war. Laws were passed abolishing divorce and banning the sale of contraceptives. Catholic religious instruction was mandatory, even in public schools.
In return, Franco secured the right to name Roman Catholic bishops in Spain, as well as veto power over appointments of clergy down to the parish priest level.
Before 1930, anti-clericalism was deeply rooted in the historic region of Catalonia, which made Barcelona and its industrial workers a major center of the Republicanism during the Civil War. In the 1940s and 1950s, the church and Catalonia went through a grassroots revival, and gained wide popular support. By the 1960s, anti-clericalism had largely disappeared in the region and the Catholic Church became a central element in revival of Catalan nationalism and provided a base for the opposition to Francoism.
In 1953 this close cooperation between the Catholic Church and the Franco regime was formalized in a new Concordat with the Vatican that granted the church specific privileges:
After the Second Vatican Council in 1965 set forth the church's stand on human rights, the Catholic Church in Spain moved from a position of unswerving support for Franco's rule to one of guarded criticism.
During the final years of the dictatorship, the church withdrew its support from the regime and became one of its harshest critics.
The Joint Assembly of Bishops and Priests held in 1971 marked a significant phase in the distancing of the church from the Spanish state. This group affirmed the progressive spirit of the Second Vatican Council and adopted a resolution asking the pardon of the Spanish people for the hierarchy's partisanship in the Civil War.
At the Episcopal Conference convened in 1973, the bishops demanded the separation of church and state, and they called for a revision of the 1953 Concordat. Subsequent negotiations for such a revision broke down because Franco refused to relinquish the power to veto Vatican appointments.
This evolution in the church's position divided Spanish Catholics. Within the institution, right-wing sentiment, opposed to any form of democratic change, was typified by the Brotherhood of Spanish Priests, the members of which published vitriolic attacks on church reformers. Opposition took a more violent form in such groups as the rightist Catholic terrorist organization known as the Warriors of Christ the King, which assaulted progressive priests and their churches.
Whereas this reactionary faction was vociferous in its resistance to any change within the church, other Spanish Catholics were frustrated at the slow pace of reform in the church and in society, and they became involved in various leftist organizations. In between these extreme positions, a small, but influential, group of Catholics--who had been involved in lay Catholic organizations such as Catholic Action--favored liberalization in both the church and the regime, but they did not enter the opposition forces. They formed a study group called Tacito, which urged a gradual transition to a democratic monarchy. The group's members published articles advocating a Christian democratic Spain.
Because the church had already begun its transformation into a modern institution a decade before the advent of democracy in Spain, it was able to assume an influential role during the transition period that followed Franco's death. Furthermore, although disagreements over church-state relations and over political issues of particular interest to the Roman Catholic Church remained, these questions could be dealt with in a less adversarial manner under the more liberal atmosphere of the constitutional monarchy.
Although church-state relations involved potentially polarizing issues, the church played a basically cooperative and supportive role in the emergence of plural democracy in Spain. Although it no longer had a privileged position in society, its very independence from politics and its visibility made it an influential force.
In 1976, King Juan Carlos de Borbon unilaterally renounced the right to name Catholic bishops. In July 1976, the Suárez government and the Vatican signed a new accord that restored to the church its right to name bishops, and the church agreed to a revised Concordat that entailed a gradual financial separation of church and state. Church property not used for religious purposes was henceforth to be subject to taxation, and gradually, over a period of years, the church's reliance on state subsidies was to be reduced.
Negotiations soon followed that resulted in bilateral agreements, delineating the relationship between the Vatican and the new democratic state. The 1978 Constitution confirms the separation of church and state while recognizing the role of the Roman Catholic faith in Spanish society.
Within this basic framework for the new relationship between the church and the government, divisive issues remained to be resolved in the late 1980s. The church traditionally had exercised considerable influence in the area of education, and it joined conservative opposition parties in mounting a vigorous protest against the education reforms that impinged on its control of the schools. Even more acrimonious debate ensued over the emotionally charged issues of divorce and abortion. The church mobilized its considerable influence in support of a powerful lobbying effort against proposed legislation that was contrary to Roman Catholic doctrine governing these subjects.
The passage of a law in 1981 legalizing civil divorce struck a telling blow against the influence of the church in Spanish society. A law legalizing abortion under certain circumstances was passed in August 1985 and further liberalized in November 1986, over the fierce opposition of the church.
Another manifestation of the redefined role of the church was contained in measures aimed at reducing, and ultimately eliminating, direct government subsidies to the church. As part of the agreements reached in 1979, the church concurred with plans for its financial independence, to be achieved during a rather lengthy transitional period. At the end of 1987, the government announced that, after a three-year trial period, the church would receive no further direct state aid but would be dependent on what citizens chose to provide, either through donations or by designating a portion of their income tax for the church. Although the church's exempt status constituted an indirect subsidy, the effect of this new financial status on the church's ability to wield political influence remained to be seen.
Since the Socialist victory in the 2004 election, the Spanish government has legalized same-sex marriage and eased restrictions on divorce. It has also expressed its intent to loosen laws against abortion and euthanasia. In response, the church and religious Catholics have been vocal in their opposition, seeking to regain some of their former influence over the country.