When Moscow's Muslims gathered at the city's main mosque Wednesday to mark Eid el-Fitr, the end of the holy month of Ramadan, tens of thousands of worshippers were forced to take their prayer mats into the street. Lines of police officers stood amid the worshippers, who also had to pass through a security check before they could pray.

As a symbol it is a powerful illustration of two things: firstly, the growing strength of Moscow's Muslim community; but secondly, the official insecurity and to some extent, hostility toward it.

Islam has always been the second biggest religion in Russia, but it had never been as visible in Moscow as it is now. Moscow has the largest Muslim population in Europe, with estimates suggesting that between 1.5 and 2 million of the Russian capital's population are of the faith. Despite this, Moscow has only six Mosques, hence the necessity for worshippers to congregate in the street.

This problem is not new either. In 2012, Hasan Fakhritdinov, imam of what is known as the city's Historical Mosque, told the BBC that the existing facilities were just not enough. "We are asking the authorities to let us build new mosques, but they are ignoring our demands," he says. "Now people have to pray outside in the rain or the snow."

Moscow Mayor Sergei Sobyanin, a frequent critic of Muslim immigrants, said in the past that the "excessive" number of Muslim newcomers to Moscow was "harmful" and that no new building permits for mosques would be granted.

Moscow Muslims Interior Ministry members stand guard as Muslims attend the morning prayers of Eid al-Fitr holiday, marking the end of the holy month of Ramadan, in Moscow, Russia, July 17, 2015. Photo: Reuters/Sergei Karpukhin

Russia's Muslims are made up of ethnic Tatars, Russia's third largest ethnic group; Azeris who settled there after fleeing the Armenian-Azeri war; natives of Russia's Caucasus; and, in recent years, tens of thousands of economic migrants from central Asia and the Middle East.

But distrust between the Muslim community and ethnic Russians remains high, in part fueled by the war in Chechnya, and subsequent terrorist attacks carried out by Muslim extremists.

A 2013 survey by VTsIOM, a state-owned pollster, found that almost one in seven Russians don't want Muslim neighbors, one quarter do not want to live near a Caucasus native, and 28 percent don't want Central Asians next door. Some 45 percent of Russians support the nationalist slogan of "Russia for ethnic Russians," the poll found, according to Al Jazeera.

This antipathy has also lead to violence against Moscow's Muslim community, and suppression by the authorities. A 2013 anti-immigrant riot, triggered by the stabbing of a Slavic man, saw Slavic rioters released by police, but thousands of migrant workers -- the target of the violence -- were detained by the authorities. In addition, politicians called for banning apartment sales to foreigners and for imposing visa restrictions on migrants from the southern Muslim nations that only a generation ago were part of the Soviet Union, Voice of America reported.

In recent months, with international sanctions over Ukraine and falling oil prices imposing increasing economic hardship on Russia, a dislike of all things foreign (albeit focused mainly on the West) has once again crept into the country's political consciousness.

With Russia's increasing alienation from the West, some experts believe President Vladimir Putin could use his country's Muslim citizens as an asset, to assist in forming alliances with conservative, Middle Eastern countries, which share Russia's unease at the perceived encroachment of liberal Western values. If this is part of Russia's diplomatic strategy, it appears to have borne little in the way of fruit thus far.