ISTANBUL — Turkish President Recep Tayyip Erdogan was set on Friday to inaugurate a landmark mosque in Istanbul’s Taksim Square, fulfilling a long-time ambition to build a Muslim house of worship at the city’s main public space that has become an emblem of the modern Turkish Republic.

Erdogan was scheduled to join a group of worshippers for the first prayers at the towering 3,000-capacity mosque on Taksim — which was also the site of the mass anti-government protests in 2013 sparked by the government’s construction plans at the adjacent Gezi Park.

The Turkish leader, who has steadily consolidated power in his 18 years in office, had long promised supporters of his Islam-oriented ruling party a mosque on Taksim, saying it is inconceivable for Istanbul’s main square not to have a Muslim house of worship.

Critics, however, see the mosque’s construction as being part of Erdogan’s plans to transform Taksim and undermine the legacy of Mustafa Kemal Ataturk who established the secular-oriented republic after the collapse of the Ottoman Empire. A cultural center at Taksim, which was named after Ataturk and seen as a symbol of his heritage, has been demolished and is being replaced by a new structure.

In 1997, Turkey’s military leaders had pressured an Islamist-led government — which Erdogan belonged to — out of power for allegedly undermining secular laws, citing its declared plans to construct a mosque on Taksim as one of the reasons.

“For years, since my childhood, they have said ‘you cannot do it,’” Erdogan told ruling party regional leaders in a speech Thursday. “But God has destined us (to build) this.”

For decades, the bustling square has been the heart of the city’s cultural scene but also the site of street battles between police and demonstrators. In 1977, 34 people were killed in the square during a May Day commemoration when shots were fired into the crowd from a nearby building.

The 2013 protests against Erdogan’s rule, grew from a sit-in demonstration by a group of protesters trying to prevent plans to demolish Gezi Park. Nine people were killed during the nationwide protests. Authorities have declared Taksim off-limits to demonstrations in recent years.