Islam in Spain

Spain is a Christian majority country, with Islam being a minority religion, practised mostly by immigrants from Muslim majority countries, and their descendants.
Islam was a major religion on the Iberian Peninsula, beginning with the Umayyad conquest of Hispania and ending (at least overtly) with its prohibition by the modern Spanish state in the mid-16th century and the expulsion of the Moriscos in the early 17th century, an ethnic and religious minority of around 500,000 people. Although a significant proportion of the Moriscos returned to Spain, or avoided expulsion, the practice of Islam had faded into obscurity by the 19th century after many years of crypto-Muslims practicing their faith in secret.
While the 2022 official estimation of Centro de Investigaciones Sociológicas (CIS) indicates that 2.8% of the population of Spain has a religion other than Catholicism, according to an unofficial estimation of 2020 by the Union of Islamic Communities of Spain (UCIDE) the Muslim population in Spain represents the 4.45% of the total Spanish population as of 2019, of whom 42% were Spanish citizens (most of them with foreign family origins), 38% Moroccans, and 20% of other nationalities.
Hispania was the Latin name which was given to the whole Iberian Peninsula, and after the fall of the Western Roman Empire (476) the Germanic tribe of Visigoths, who adopted Christianity, ended up ruling the whole peninsula until the Islamic conquest (during that time they pushed another Germanic tribe out—the Vandals – and conquered another one—the Suevi). It is frequently stated in historical sources that Spain was one of the former Roman provinces where the Latin language and culture grew deep roots. After the fall of the Empire, the Visigoths continued the tradition by becoming what was probably the most Romanized Teutonic tribe. Under Visigothic rule Spain was filled with extreme instability due to lack of communication between the native Spaniards and the new rulers, who followed the Germanic notion of kingship. Visigothic kings were considered the first among equals (the nobility), and they could easily be overthrown if they did not keep the different factions happy.
News of the political unrest which existed from the late 6th century through the early 8th century was eventually received by the rulers of the growing Islamic empire which existed along the North African coast. Several historical sources state that the Islamic caliphate had not actually targeted the Visigothic Kingdom for conquest, but political divisions within it created an opportunity which was successfully exploited by an army which was led by the Muslim general Tariq ibn-Ziyad. The last Visigoth king, Roderick, was not considered a legitimate ruler by all of the inhabitants of the Spanish Kingdom, and some Visigothic nobles aided the Islamic conquest of Spain. One name frequently mentioned is Count Julian of Ceuta who invited Tariq ibn-Ziyad to invade southern Spain because his daughter had been raped by King Roderick.
On April 30, 711, Muslim General Tariq ibn-Ziyad landed at Gibraltar and by the end of the campaign most of the Iberian Peninsula (except for small areas in the north-west such as Asturias and the Basque territory) were brought under Islamic rule. This campaign's turning point was the battle of Guadalete, where the last Visigothic king, Roderick, was defeated by general Tariq ibn-Ziyad. Roderick ceases the throne in the year 711, and is later executed by Tariq ibn-Ziyad. After the defeat of Roderick, the Visigoth dominion over the Iberian peninsula folded and fell apart from the Northern coast of the Iberian Peninsula, and the province of Septimania (an area of France going from the Pyrenees to Provence), all areas previously under the rule of the Visigoths were now under Islamic rule. Muslim forces attempted to move north-east across the Pyrenees Mountains toward France, but were defeated by the Frankish Christian Charles Martel at the Battle of Tours in 732.
Islamic rule of the Iberian peninsula lasted for varying periods of time, which ranged from only 28 years in the extreme northwest (Galicia) to 781 years in the area which surrounded the city of Granada in the southeast. This Empire added contributions to society such as libraries, schools, public bathrooms, literature, poetry, and architecture. This work was mainly developed through the unification of people of all faiths. While the three major monotheistic religious traditions certainly did borrow from one another in Al-Andalus, benefiting especially by the blooming of philosophy and the medieval sciences in the Muslim Middle East, recent scholarship has brought into question the notion that the peaceful coexistence of Muslims, Jews, and Christians — known as the convivencia — could be defined as "pluralistic." People of other religions could contribute to society and the culture developed in this time. One of the reasons for such great success under this empire was the legal terms offered to the public, which differed from the conditions which were implemented by the Visigoth kingdom which preceded it.
Moreover, the appearance of Sufism on the Iberian peninsula is especially important because Sufism's "greatest shaykh," Ibn 'Arabi, was himself from Murcia. Nakshbandi Sufi order is the widely followed Sufi order in Spain.
The topic of Convivencia remains a very hotly debated topic among scholars, with some of them believing that Spain was pluralistic under Muslim rule while others believe it was a very difficult place for non-Muslims to live in. Those who believe that Muslim ruled Spain was pluralistic point to the audio narration in the Museum of The Three Cultures in Cordoba, Spain, where the audio narration says that "when the East was not separated from the West, Muslims were not separated from Jews or Christians". Another scholar argues that "It became possible to be a pious Jew who could recite a pre-Islamic ode or take the peripatetic tradition seriously, in great measure because pious Muslims did it". The Muslim ruler Abd-al-Rahman III "worked directly with the Mozarabs, a controversial term which is generally used to refer to Christians who lived under Muslim rule, and placed them in positions of power. Furthermore, the Jews and Christians could practice their religions without fear of harassment or persecution." The Muslim rulers of Spain "relied on the Jews for diplomacy and public administration who were inaugurated into posts of commerce and played important roles in cities such as Toledo and Cordoba".
On the other side of the debate, many scholars believe that Muslim rule of Spain was far from a utopian society where all religions treated each other with respect. In fact, "Uprisings in Cordoba in 805 and 818 were answered with mass executions and the destruction of one of the city's suburbs". In addition, in regard to Jews and Christians in Andalusia, "one 11th-century legal text called them members of "the devil's party" and they "were subject to special taxes and, often, dress codes". Many scholars believe that this more benign view of convivencia "masks the very presence of institutional fundamentalism in medieval Spain – both its Jewish and Muslim manifestations in the nature of forced conversions, exile, lower standards of citizenship, higher taxation and violence". It seems that class distinctions also played a role in convivencia. In fact, "many of the lower echelons of Jewish and Christian society remained segregated or in conflict with their Abrahamic counterparts". Other scholars believe that Christians and Jews were treated as second class citizens where "Under Muslim rule, especially following the arrival of the Almoravids and the Almohades, both Christianity and Judaism were scarcely tolerated and regarded as decidedly "inferior" religions".
In time Islamic migrants from places as diverse as North Africa to Yemen and Syria and Iran invaded territories in the Iberian peninsula. The Islamic rulers called the Iberian peninsula "Al-Andalus".
For a time, Al-Andalus was one of the great Muslim civilizations, reaching its summit with the Umayyad Caliphate in the 10th century. Al-Andalus had the following chronological phases:
(Note: the dates when the different taifa kingdoms were annexed by Almoravids and Almohads vary)
The Madrasah of Granada was founded by the Nasrid dynasty monarch Yusuf I, Sultan of Granada in 1349 and housed many of the most greatest prominent scholars of the period.
After the disintegration of the Caliphate, Islamic control was gradually eroded by the Christian Reconquista. The Reconquista (Reconquest) was the process by which the Catholic Kingdoms of northern Spain eventually managed to succeed in defeating and conquering the Muslim states of the Iberian Peninsula. The first major city to fall to Catholic powers was Toledo in 1085, which prompted the intervention of Almoravids. After the battle of Las Navas de Tolosa in 1212, most of Al-Andalus fell under control of the Catholic kingdoms, the only exception being the Nasrid dynasty Emirate of Granada. The Granada War (Guerra de Granada) of the Reconquista began in 1482 against the Emirate of Granada. It was not until 1492 that the Emirate of Granada with city of Granada and the Alhambra and Generalife Palaces, the last remaining Muslim territory in al-Andalus, fell in the Battle of Granada to forces of the Catholic Monarchs (los Reyes Catolicos), Queen Isabella I of Castile and her husband King Ferdinand II of Aragon.
The conquest was accompanied by the Treaty of Granada signed by Emir Muhammad XII of Granada, allowing the Spanish crown's new Muslim subjects a large measure of religious toleration. They were also allowed the continuing use of their own language, schools, laws and customs. But the interpretation of the royal edict was largely left to the local Catholic authorities. Hernando de Talavera, the first Archbishop of Granada after its Catholic conquest, took a fairly tolerant view.
However 1492 started the monarchy's reversal of freedoms beginning with the Alhambra Decree. This continued when Archbishop Talavera was replaced by the intolerant Cardinal Cisneros, who immediately organised a drive for mass forced conversions and burned publicly thousands of Arabic books (manuscripts). Outraged by this breach of faith, in 1499 the Mudéjars rose in the First Rebellion of the Alpujarras, which was unsuccessful and only had the effect of giving Ferdinand and Isabella a pretext to revoke the promise of toleration. That same year, the Muslim leaders of Granada were ordered to hand over almost all of the remaining books in Arabic, most of which were burned. (Only medical manuscripts were spared; those manuscripts are in the Escorial library.) Beginning in Valencia in 1502, Muslims were offered the choice of baptism or exile. The option of exile was often not feasible in practice because of the difficulty in uprooting one's family and making the journey to Muslim lands in North Africa, the inability to pay the fee required by the authorities for safe passage, and the general tendency by the authorities to discourage and hinder such exodus.
The majority therefore are forced to accept conversion, becoming known as "New Christians". Many of the New Christians (also called "Moriscos"), though outwardly Catholic, continued to adhere to their old beliefs in private as crypto-Muslims. Responding to a plea from his co-religionists in Spain, in 1504 Ahmad ibn Abi Jum'ah, an Islamic scholar in North Africa, issued a fatwa, commonly named the "Oran fatwa", saying that Muslims may outwardly practice Christianity, as well as drink wine, eat pork and other forbidden things, if they were under "compulsion" to conform or "persecution".
The clandestine practice of Islam continued well into the 16th century. In 1567, King Philip II finally made the use of the Arabic language illegal, and forbade the Islamic religion, dress, and customs, a step which led to the Second Rebellion of Alpujarras, involving acts of brutality from the Muslim rebels, against Christian locals. The Moriscos of Granada were as a result dispersed across Spain. 'Edicts of Expulsion' for the expulsion of the Moriscos were finally issued by Philip III in 1609 against the remaining Muslims in Spain. The expulsion was particularly efficient in the eastern region of Valencia where they made up 33% of the population and ethnic tensions between Muslim and non-Muslim populations were high, as locals came under harassment by Muslim brigands. The corresponding expulsion of Muslims from the Kingdom of Castille and Andalusia was officially completed in 1614. Unlike the Kingdom of Aragon and Valencia, Moriscos were highly integrated in the rest of Spain significant number of them avoided expulsion or returned en masse, with the protection of non-morisco neighbours and local authorities.
The last mass prosecution against Moriscos for crypto-Islamic practices occurred in Granada in 1727, with most of those convicted receiving relatively light sentences. Some of the Morisco community including these final convicts were said to have kept their identity alive at least through the late eighteenth century.
Nevertheless, communities of Moorish freed slaves known as "moros cortados" continued to be present throughout various parts of Spain, many of which had been freed as a result of a reciprocal deal with Morocco in 1767. Such former slaves, although baptised continued to discreetly practice their religion. As a result of a second Treaty with Morocco in 1799, the King of Spain formally guaranteed the right of Moroccans in Spain to practice their religion in exchange for Spanish Catholics being granted the same rights in Morocco.
The Spanish Constitution of 1978 declares in Art. 16 that “No one may be compelled to make statements regarding his religion, beliefs or ideologies” which means that all data on religious beliefs is approximated. The evolution of the Muslim population has been linked to the increase of immigration in the last two decades, which began with the entry of Spain in the European Economic Community (1986), following the economic growth and the closure of European borders to third countries. Official estimations by the Centro de Investigaciones sociológicas (CIS) say there are 2.9% believers in other religions, of whom around 2% would be Muslims.
The Autonomous Communities with the highest Muslim population, in absolute terms, are Catalonia, Andalusia, the Community of Madrid, and the Region of Murcia. However, in relation to the overall population within the Autonomous Communities, the cities of Ceuta and Melilla stand out with the highest percentages of Muslims, following the Region of Murcia, Catalonia, and La Rioja. Moreover, it is worth mentioning that the Muslim population in the cities of Ceuta and Melilla, which has close ties to the Moroccan population, has been active in the creation of associations and pioneer in the implementation of Islam related measures in different political fields. Unofficial sources for the subsequent tables and graphics:
The ethnic background of the Spanish Muslim population has two main nationalities: Spanish and Moroccan, followed by the Pakistani and Senegalese nationalities. Within the foreign-born Muslim population, four geographic zones can be highlighted: the Maghreb, Sahel, the Indian Subcontinent and the Middle East.
In “Others” we can find the following countries: Mauritania (8,165), Syria (7,321), Cameroon (6,232), Iran (5,913), Turkey (5,000), Guinea-Bissau (4,413), Ivory Coast (4,249), Egypt (4,020), Albania (3,004), Kazakhstan (2,438), Tunisia (2,287), Lebanon (2,116), Indonesia (1,764), Iraq (1,554), Jordan (1,315), Burkina Faso (1,276), Saudi Arabia (745), Sierra Leone (685), Togo (451), Benin (338).
The creation of Islamic communities as legal entities has been an instrument for Muslims to organize themselves in order to communicate with public institutions and achieve the rights established in the legal arrangements. Since the signature of the Cooperation Agreement between the State and the Islamic Commission of Spain in 1992 and the increase of migratory flows, there has been a significant growth of organisations in form of religious communities, associations, and federations. The local communities and associations can incorporate themselves directly within the Islamic Commission or through an already integrated federation. In 2019, there were 49 Islamic federations, 1,704 communities, and 21 associations registered in the Religious Entities Office of the Ministry of Justice (RER). A total of 365 religious entities remained outside the Islamic Commission.
In Spain, Islam is considered a minority though "deep-rooted" religion together with Judaism, the Evangelic Church, the Church of Jesus Christ of Latter-day Saints, the Jehovah's Witnesses, Buddhism and the Eastern Orthodox Church. In this sense, the Spanish state established a legal framework for the accommodation of those remarkable religions within the legal framework of cooperative church-state relations. Until now, just the Jewish, the Evangelic and the Muslim communities have signed a formal Agreement with the state.
The colonialist policy conducted by the Spanish state during the 19th and the 20th century mostly in North-Africa shaped also the politics toward the Islamic religion in the metropole. After the Spanish Civil War (1936–1939) the dictator Francisco Franco rewarded the engagement of Moroccan troops in his army with the construction of the first modern mosque in the Iberian Peninsula since the Muslim presence in Al-Ándalus during the Middle Ages, namely the Al-Morabito Mosque in Córdoba. Furthermore, at the beginning of the civil war, it was assigned a place within the San Fernando Cemetery in Sevilla (Cementerio de San Fernando) to bury Muslim soldiers, which was closed after the conflict. However, the Spanish State during Franco's dictatorship was defined as a Catholic confessional state and did not recognise any public expression of other religions until the Law of Religious Liberty in 1967, which means that from 1939 to 1967 Muslims could only exercise their religion in the private sphere. From then on, the Muslim community began to organise itself in associations. In 1971, Riay Tatary Bakr, the later president of the Islamic Commission of Spain, helped to create the Association of Muslims in Spain (AME) based in Madrid, which constructed the Madrid Central Mosque or Abu Bakr Mosque with private funds mostly from Saudi Arabia.
In the Spanish case, the legal framework for the governance of religious diversity has its foundations in the historical church-state model. In political science, the theory explaining how historical patterns can influence new policy outcomes is called path dependency. Similarly, there have been many studies linking the governance of Islam in European countries to pre-existing church-state models. During Franco's dictatorship, the Spanish state signed the Concordat of 1953 with the Vatican, which granted the Catholic Church with some privileges such as state funding and the exemption from government taxation. In the Spanish transition to democracy, the government replicated the same model by signing new agreements in 1976 and 1979, which gave the concordat the status of an international treaty.
The Constitution of 1978 stipulated in Article 16 that all beliefs within the Spanish society will be taken into account and the state will maintain cooperative relations with the Catholic Church as well as with other religious denominations. Furthermore, The Organic Law of Religious Liberty (LOLR) of 1980 specified in Article 7 that the state should establish Cooperation Agreements with those “Churches, Confessions and Communities” that had achieved 'deep-rootedness' (Notorio arraigo) in Spanish society, due to their scope and the number of believers. The criteria were the following ones:
This law allowed the state to sign Cooperation Agreements with the Jewish, the Evangelic and the Muslim communities, which were previously recognised as "deep-rooted" religions. The definition of the requirements and procedure for obtaining "deep-rootedness" was reformulated in the Royal Decree 593/2015. In 1984, the Advisory Commission of Religious Liberty (CARL), an administrative organ within the Ministry of Justice, recognised both the Evangelic and the Jewish confessions, and in 1989 the Islamic religion achieved his recognition as well.
Following the church-state model, the agreement would be signed by two parties: on the one side, the Ministry of Justice representing the Spanish State, and on the other side, one representative body for each religious denomination. This obligated the different religious communities to organise themselves in a centralised and hierarchal way within a short period of time. Moreover, this model did not take into account the heterogeneous nature of the communities, especially for the Islamic religion. In 1989, after the recognition of the Islam as "deep-rooted" religion, the Spanish Federation of Islamic Religious Entities (FEERI) was created with 15 federated associations in order to serve as the single interlocutor with the state. However, in 1991 a group of communities left the Federation to form a new one under the name Union of Islamic Communities of Spain (UCIDE). So far, there were two competing Islamic federations, which wanted to monopolise the communication with the state. The request for a Cooperation Agreement should be carried out by the religious confession and then reviewed by the public administration. Both federations started to draft an agreement in parallel. Finally, the solution was found in the creation of the Islamic Commission of Spain, founded by the FEERI and the UCIDE and established on 18 February 1992. Its raison d'être was the "negotiation, signature and follow- up on the Cooperation Agreement with the state" as it is written in the first article of his statutes.
1992 was chosen as the year for the signature of the Cooperation Agreements, due to the 500th anniversary regarding the conquest of the Nasrid Kingdom of Granada and the Expulsion of Jews from Spain. Because of that, many scholars have seen the Agreements as a symbolic act rather than as an instrument for the management of religious diversity. Nevertheless, the agreements aimed to equate the one signed with the Catholic Church and so to accommodate the religions mentioned within public institutions and the school system, to guarantee the exemption from taxation and the involvement of the religious communities in the preservation of their related cultural heritage. The Cooperation Agreement between the State and the Islamic Commission of Spain includes 14 articles and three additional provisions that can be summarised in 9 topics: legal affairs, worship places, imams, marriage and festivities, religious assistance, religious education, fiscal benefits, cultural heritage, and halal products. In the following sections, a summary with relevant facts is provided:
The implementation of the Cooperation Agreement has been a long process that has not been yet completed. When the Agreement was signed in 1992, no other regulations regarding the concrete implementation nor financial means were determined directly afterwards. Moreover, since Spain is a semi-federal state, the competencies over the agreed measures correspond to different administrative levels: the Central Government, the Autonomous Communities, and the Municipal councils. The Agreement did not include, however, any references regarding the jurisdiction of the measures.
The Cooperation Agreement identifies mosques and cemeteries as Islamic places of worship. In Spain, there are 13 big mosques in the cities of Madrid (2), Valencia (1), Córdoba (2), Granada (1), Ceuta (2), Melilla (2), Fuengirola (1), Marbella (1) and Málaga (1). [See: List of Mosques in Spain]. However, in practice, most common places of worship are small oratories established in commercial premises, garages, and private apartments. The religious communities are mostly renting these establishments, just a minority are private property. A study from 2009 about the religious situation in Castile-La Mancha identified 46 religious communities of which only 4 had a private property. At the autonomic level, the Community of Madrid signed an agreement with the UCIDE in 1998, which referred in the third clause to the promotion of transfer of land to construct mosques and places of worship in Madrid. In Catalonia, on the other side, a law was adopted in 2009 to deal with the granting of licenses by municipal councils. Especially in Catalonia, there have been many cases of social opposition to mosques. In a study conducted by Avi Stor 41 cases were reported in Catalonia between 1990 and 2013, the total cases in Spain was 74 from 1985 to 2013.
The competence over religious assistance varies across the institutions involved. For instance, the central government is responsible for the religious assistance in penitentiary centres except in Catalonia. For the religious assistance in Alien Internment Centres (CIES) has also the Spanish government, under the Directorate-General of the Police (DGP), the jurisdiction. On the other side, the Autonomous Communities have the competencies in the area of healthcare, thus they have to manage the religious assistance in hospitals and other healthcare centres. In 2006, a decree was adopted to regulate the religious assistance in penitentiary centres, and in 2007 an economic agreement was signed for its financing. Furthermore, the Generalitat de Catalunya signed in 2008 a collaboration agreement with the Islamic and Cultural Council of Catalonia (Consell Islàmic i Cultural de Catalunya) to guarantee the religious assistance in Catalan penitentiary centres through the Directorate General of Religious Affairs (DGAR). This collaboration agreement was updated in 2015 and in 2019, this time with the involvement of the Federation Islamic Council of Catalonia. Until 2019, there were 20 imams for the religious assistance in penitentiary centres in Spain, 8 of them engaged in Catalan prisons. Regarding the religious assistance in CIES, 7 imams were reported in 2019. Moreover, there is no available data for the employment of imams in health care centres. Finally, the religious assistance in the Armed forces, under the jurisdiction of the Ministry of Defence, has not been implemented yet.
Education is a complex matter since there is no exact distribution of competencies between the state and the Autonomous Communities. The state establishes some basic rules for applying Article 27 of the Constitution, while the communities have to develop the legislative framework and execute the educational programmes. While the education competencies have been transferred to most of the Autonomous Communities, the Education Ministry remains responsible for the competencies in Andalusia, Aragon, the Canary Islands, Cantabria, Ceuta, and Melilla.
Regarding the regulatory framework, the Spanish government signed an agreement about the designation and economic regime of the Islamic religion teachers that went into effect for the 1996–1997 school year. This agreement referred just to public schools in primary and secondary education, although the Cooperation Agreement explicitly mentioned the semi-private schools, which are co-funded by the Public Administration. In 2000, 20 teachers were designated for the cities of Ceuta and Melilla and in 2005 another 20 teachers would cover the Islamic religious teaching in the communities whose competencies remained by the Spanish State. Since then, the Islamic Commission of Spain has signed different agreements with the remaining Autonomous Communities for the implementation of Islamic religious teaching. However, there was not always the need for an agreement at the autonomic level, since some communities introduced Islamic religious teaching in their school systems on the basis of the Cooperation Agreement of 1992 as in the case of islamic religious teaching in the primary school for Andalusia. In 2019, a total of 80 Islamic religious teachers were reported. On the following table, the Autonomous Communities are listed with the respective year of implementation of the Islamic religion subject and the total number of teachers for each one in 2019. While Navarre, Galicia, and Asturias opened the opportunity to take the subject if the requirements are fulfilled, the Region of Murcia has not yet answered the petitions of the Islamic Commission of Spain. Catalonia began a pilot program for the school year 2020–2021.
The Cooperation Agreement established fiscal benefits and tax exemptions for the Islamic religious communities but did not stipulate a financial mechanism similar to the one for the Catholic Church. However, in the aftermath of the Madrid bombings of 2004, the Spanish government saw the need for integrating Muslims in Spanish society besides of formulating policies to ensure national security. In December 2004, the Foundation for Pluralism and Coexistence (FPC) was created to support programmes related to cultural, educative, and social integration for those religions with "deep-rootedness", i.e. the Evangelic Church, Judaism, and Islam. Catalonia's regional government had already in 2000 created the Directorate General of Religious Affairs (DGAR) and in 2004, this public agency launched a programme to provide access to public funding for activities regarding the integration of minority religions, which was developed before the creation of the FPC at the national level.
The Agreement stipulated that the Islamic Commission of Spain would be the organization responsible for obtaining the Halal guarantee mark from the Industrial Property Registry. In practice, it was the Islamic Committee of Spain (Junta Islámica de España), one of the communities integrated within the FEERI, that created a Halal Institute in 2003 to regulate and certify food and products in line with the requirements of Islamic rituals under the trademark "Halal Guarantee Distinction of the Islamic Committee" (Marca de Garantía Halal de Junta Islámica). Their claim to be the only official Institution in Spain that guarantees the halal production, however, has not been accomplished since it can be found so far 45 national trademarks in the Spanish Patent and Trademark Office website which refer to the same product categories (Nice Classification: 1, 5, 29–33, 39, 43), without counting the European and international products commercialised in Spain. Furthermore, one of these trademarks was registered by the Islamic Commission of Spain in 2018, claiming its official mandate established in the Cooperation Agreement.
Jihadists entered in Spain from 1994, when an al-Qaeda cell was established. In 1996, the Armed Islamic Group of Algeria (GIA), an organisation affiliated with al-Qaeda, founded a cell in the province of Valencia. In the 1995–2003 period, slightly over 100 people were arrested for offences related to militant salafism, an average of 12 per year.
In 2004, Madrid commuters suffered the 2004 Madrid train bombings, which were perpetrated by remnants of the first al-Qaeda cell, members of the Moroccan Islamic Combatant Group (GICM) plus a gang of criminals turned into jihadists.
In the period 2004–2012, there were 470 arrests, an average of 52 per year and four times the pre-Madrid bombings average which indicated that the jihadist threat persisted after the Madrid attack. In the years after the Madrid attack, 90% of all jihadists convicted in Spain were foreigners, mainly from Morocco, Pakistan and Algeria, while 7 out of 10 resided in the metropolitan areas of Madrid or Barcelona. The vast majority were involved in cells linked to organisations such as al-Qaeda, the GICM, the Algerian Salafist group Group for Preaching and Combat which had replaced the GIA, and Tehrik-i-Taliban Pakistan.
In the period 2013, jihadism in Spain transformed to be less overwhelmingly associated with foreigners. Arrests 2013–2017 show that 4 out of 10 arrested were Spanish nationals and 3 out of 10 were born in Spain. Most others had Morocco as a country of nationality or birth with its main focus among Moroccan descendants residing in the North African cities of Ceuta and Melilla. The most prominent jihadist presence was the province of Barcelona. In 2013 and 2014 there were cells associated with Al-Nusra Front, the Islamic State of Iraq and the Levant.
Survey published in 2019 by the Pew Research Center found that 54% of Spaniards had a favourable view of Muslims, whereas 42% had an unfavourable view.