Interior Minister Ali Yerlikaya said 53 people were detained and 16 police officers were injured in protests that began at university campuses, Istanbul city hall and elsewhere on Thursday, triggering scattered clashes.
Imamoglu, who is President Recep Tayyip Erdogan's main political rival and leads him in some polls, was detained on Wednesday facing charges including graft and aiding a terrorist group.
The mayor's main opposition Republican People's Party (CHP) has condemned the move as politically motivated and urged people to lawfully demonstrate, while European leaders have criticised the detention as democratic backsliding.
Yerlikaya and the justice minister, Yilmaz Tunc, criticised the calls for action from CHP leader Ozgur Ozel as "irresponsible" amid a four-day ban on public gatherings.
"Gathering and marching in protest are fundamental rights. But calling to the streets over an ongoing legal investigation is illegal and unacceptable," Tunc said on X early on Friday.
Tunc said the courtroom was the place to respond to any legal process and called for calm, adding the "independent and unbiased judiciary" was evaluating the case.
Demonstrations took place on Thursday in Ankara, Izmir and Istanbul, as well as other provinces across the country, with police erecting barricades on several main streets.
Erdogan dismissed the opposition's criticism as "theatrics" and "slogans" that distract from its internal mistakes.
Speaking at the main Istanbul rally late on Thursday, the CHP's Ozel responded: "Hey Erdogan, you're most scared of the streets. We are now on the streets, in squares. Continue to be afraid."
"While you keep the one we elected in custody, we will not sit at home," he said before thousands of supporters.
"Mr Tayyip, you are scared and you are asking, 'Are you calling people to the streets? Are you calling people to the squares?' Yes. I didn't fill up these squares or these streets, you did."
Since Imamoglu's detention, many supporters had called for more concrete and organised action from the CHP, making Ozel's call a significant escalation of pressure on the government.
The move against Imamoglu, 54, a two-term mayor, comes as the CHP was set to announce him as its presidential candidate on Sunday.
It has called for non-party members to vote for him in ballot boxes set up across the country, as a sign of public resistance.
No presidential election is scheduled until 2028 but Erdogan, 71, could call it early to avoid hitting a two-term limit if he decides to run again.
Imamoglu's detention caps a months-long legal crackdown on opposition figures that has been criticised as an attempt to hurt their electoral prospects and silence dissent, charges the government denies.
Ankara has dramatically curbed civil disobedience since the 2013 nationwide Gezi Park protests against Erdogan's government prompted a violent state crackdown.
A government appointee could replace the mayor if he is formally arrested in coming days as part of the probe charging him with aiding the outlawed Kurdistan Workers Party, deemed a terrorist organisation by Turkey and its Western allies.
Ozel told Reuters that the party would resist any unjust replacement of Imamoglu.
His detention came a day after a university annulled his degree, which if upheld would block him from running for president under constitutional rules that require candidates to have a four-year degree.