Police questioned Imamoglu for around five hours on Saturday as part of an investigation into allegations of aiding the outlawed Kurdistan Workers' Party, or PKK, the Cumhuriyet newspaper reported.
A day earlier he was questioned for four hours over the corruption accusations. The mayor rejected all charges during both interrogations.
He was later transferred to a courthouse for questioning by prosecutors along with some 90 other people who were also detained with him.
The authorities barred access to the courthouse using barricades on local roads and closing nearby metro stations. Hundreds of police officers and over a dozen water cannon trucks were deployed.
Still, hundreds gathered in front of the building shouting: "Rights, law, justice!"
Crowds also began to rally outside the city hall for a fourth night in a show of support for the mayor.
Interior Minister Ali Yerlikaya posted on social media that 343 suspects had been detained in protests in major cities on Friday night.
"There will be no tolerance for those who seek to violate societal order, threaten the people's peace and security, and pursue chaos and provocation," Yerlikaya said.
The mayor, who is a popular opposition figure and seen as a top challenger to President Recep Tayyip Erdogan, was detained on Wednesday following a dawn raid on his residence over allegations of financial crimes and links to Kurdish militants.
Dozens of other prominent figures, including two district mayors, were also detained.
Many view the arrest as a politically driven attempt to remove a popular opposition figure and key challenger to Erdogan in the next presidential race, scheduled for 2028.
Government officials reject accusations that legal actions against opposition figures are politically motivated and insist that Turkey's courts operate independently.
Imamoglu's arrest has ignited protests that have steadily increased in intensity.
On Friday, police in Istanbul used pepper spray, tear gas and rubber bullets to push back hundreds of protesters who tried to break through a barricade in front of the city's historical aqueduct while hurling flares, stones and other objects at officers.
Police also dispersed groups that had rallied outside of the city hall for a third night after the opposition Republican People's Party leader, Ozgur Ozel, delivered a speech in support of the mayor.
Simultaneously, police broke up demonstrations in Ankara, the capital, as well as in the coastal city of Izmir.
Thousands marched in several other cities calling on the government to resign.
Earlier, Erdogan said the government would not tolerate street protests and accused the opposition party of links to corruption and terrorist organisations.
"An anti-corruption operation in Istanbul is being used as an excuse to stir unrest in our streets. I want it to be known that we will not allow a handful of opportunists to bring unrest to Turkey just to protect their plundering schemes," Erdogan said.
Authorities in Ankara and Izmir, meanwhile, announced a five-day ban on demonstrations following a similar measure imposed earlier in Istanbul.
Imamoglu's arrest came just days before he was expected to be nominated as the opposition Republican People's Party's presidential candidate in a primary on Sunday.
Ozel has said the primary will go ahead as planned.