President Recep Tayyip Erdogan inaugurated an imposing new mosque in Istanbul on Friday, fulfilling a decades-old goal and stamping a religious identity on the landmark Taksim Square in the heart of Turkey's largest city. The Taksim mosque and its 30-metre high dome tower symbolically over a monument to the foundation of the Turkish republic by Mustafa Kemal Ataturk, whose staunchly secular legacy has been eroded by nearly two decades of Mr Erdogan's rule. After performing Friday prayers with thousands of worshippers, Mr Erdogan said completion of the mosque marked the culmination of a dream for Turks, and that the call to prayer would be heard there "until the end of time". Mr Erdogan told crowds outside the mosque that before building work started four years ago there was not even a prayer room at the site. "Worshippers were trying to pray here on top of newspapers, literally like a hen-house," he said. Construction of the mosque began in February 2017 in a project championed by Mr Erdogan, a devout Muslim, and his Islamist-rooted AK Party, but which was beset for decades by court battles and public debate. Officials on Friday shared on Twitter a video showing Mr Erdogan in 1994, the year he became mayor of Istanbul, pointing from the top of a building towards the area where he said he would build the mosque, the exact spot where it now stands. It is one of many construction projects with which Mr Erdogan is leaving his mark on Turkey, including a huge hilltop mosque overlooking the Asian side of Istanbul. Last year he reconverted into a mosque the city's Byzantine-era Hagia Sophia, for centuries the world's largest church before being turned into a mosque and museum in turn. Supporters of the Taksim project said there were not enough Muslim places of worship close to one of the city's busiest areas. Opponents considered it an attempt to impose a religious tone on the square, which features a cultural centre dedicated to Ataturk that was demolished and is being rebuilt. The mosque complex, with two towering minarets, will be able to host as many as 4,000 worshippers and includes an exhibition hall, a library, car park and soup kitchen, state-owned Anadolu news agency said. Pro-government newspapers hailed the new mosque. <em>Aksam</em>'s headline mocked critics who fear creeping religiosity: "It looks great. A mosque was built in Taksim and neither has sharia come, nor has the republic collapsed," it said. The inauguration coincided with the date when protests began 100 metres away in Gezi Park, before growing into the huge demonstrations against Mr Erdogan's government that spread across Turkey in June 2013. The Gezi protests began on May 28, 2013, after demolition work began in one corner of the park the previous evening, knocking down a wall and some trees, drawing a small group of protesters who camped out at the site. The anniversary of the protests is generally marked on May 31, when the protests escalated. In June of that year, hundreds of thousands of people took to the streets in demonstrations against a plan to build a replica Ottoman barracks on Gezi Park.