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.
 While in 2003 there were 1.23% of Muslims (both nationals and foreigners) compared to the total population, in 2019 the percentage has raised to 4.45%.

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.
Sources for the subsequent tables and graphics:
The ethnic background of Muslim population has two main nationalities: Spanish and Moroccan, it follows the Pakistani and the Senegalese nationality.
Within the foreign Muslim population, three geographic zones can be highlighted: the Arab Maghreb, West Africa, 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 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.  While in 2003 there were 1.23% of Muslims (both nationals and foreigners) compared to the total population, in 2019 the percentage has raised to 4.45%. 
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. Sources for the subsequent tables and graphics:
The ethnic background of Muslim population has two main nationalities: Spanish and Moroccan, it follows the Pakistani and the Senegalese nationality. Within the foreign Muslim population, three geographic zones can be highlighted: the Arab Maghreb, West Africa, 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).
Islam in Spain