By Birsen Altayli, Ece Toksabay and Ali Kucukgocmen
ISTANBUL (Reuters) -Thousands of Turks ramped up protests on Thursday despite a ban on street gatherings over what they called the undemocratic detention of Istanbul's mayor Ekrem Imamoglu, as the opposition sought to pin the blame on President Tayyip Erdogan.
Some protestors clashed with police in Ankara, Izmir and Istanbul, including at universities, and many rallied at a municipal headquarters in Istanbul after authorities erected barricades blocking several streets across the country.

Imamoglu, 54, Erdogan's main political rival, was taken in on Wednesday facing charges of graft and aiding a terrorist group, a move that the opposition condemned as a "coup attempt" and that sparked an initial round of demonstrations and criticism from European leaders.
The move against the popular two-term mayor caps a months-long legal crackdown on opposition figures that has been criticised as a politicised attempt to hurt their electoral prospects and silence dissent, charges the government denies.
Erdogan, in his first comments on the detention, dismissed opposition criticism as "theatrics" and "slogans" for which the country had no time.
But in an interview, Ozgur Ozel, chairman of the main opposition Republican People's Party (CHP) that includes Imamoglu, said Erdogan feared facing the mayor in a vote and wanted to "take him out of the game" and cut his party's ties with the city.

He said that any move barring Imamoglu from running for president in the next election would only strengthen the opposition's support, adding that the CHP will appoint him its candidate on Sunday at a scheduled vote.
"We believe Imamoglu will win. If his candidacy is blocked, we believe this will turn into much greater support," Ozel told Reuters in his first interview with foreign media since the detention.
"This nation has never forgiven anyone trying to lift the legitimacy of the ballots," he said next to a small room at the Istanbul municipality headquarters - with crowds gathering outside - where he intends to overnight until Imamoglu is released.
ERDOGAN

Elections are not scheduled until 2028 but would need to come earlier if Erdogan, 71, who has run Turkey for 22 years, wants to run again. Imamoglu leads the president in some polls.
Addressing a dinner for former party members in Ankara, Erdogan said the opposition seeks to cover up its mistakes. Its issues "are not the country's issues, but the issues of a handful of opportunists in their headquarters," he said.
The government has warned against tying Erdogan or politics to Imamoglu's arrest, and says the judiciary is independent in answer to criticism that arrests are politically motivated.
Authorities imposed a four-day ban on gatherings and restricted access to some social media to curb communications, with dozens of people detained over what authorities called provocative posts.

Police used water cannons to disperse crowds in the capital Ankara and western city of Izmir on Thursday evening. The government said six police officers were injured during demonstrations in Istanbul, the country's largest city.
From inside the police station where he was held, Imamoglu had earlier called on members of the judiciary and Erdogan's ruling party to fight the injustice of his detention.
"These events have gone beyond our parties or political ideals," he said on social media platform X. "It is time to raise our voices."
Civil disobedience has been dramatically curbed in Turkey since the nationwide Gezi Park protests against Erdogan's government in 2013, which prompted a violent state crackdown.

But protestors have chanted anti-government slogans in the last two days and, in Istanbul, hung banners of Imamoglu and the nation's founding leader Mustafa Kemal Ataturk alongside Turkish flags.
"They hastily detained our mayor, whom we elected with our votes," said Ali Izar, an opposition supporter in central Istanbul. "I do not think this is a democratic practice and I condemn it."
MARKET FALL
The detention sparked a crash and partial recovery in the lira on Wednesday, which by Thursday was worth nearly 38 to the dollar, compared to 36.67 beforehand.
Amid worries about eroding rule of law and concerns over slower rate cuts, bank shares in particular tumbled on the Istanbul bourse, and the central bank hiked its overnight rate.
Authorities on Thursday seized a construction company co-owned by Imamoglu and handed control over to a court, according to the Istanbul Chief Public Prosecutor's office and financial crime investigation reports.
Most of the 105 people arrested along with Imamoglu were municipality staff.
(Additional reporting by Mert Ozkan, Mehmet Emin Caliskan and Umit Bektas in Istanbul and Tuvan Gumrukcu and Huseyin Hayatsever in Ankara; Writing by Jonathan Spicer; Editing by Alex Richardson, Andrew Cawthorne, Alexandra Hudson and Diane Craft)