Senegal's opposition leader Ousmane Sonko spent his first night in police custody after being arrested on Wednesday in Dakar on his way to court to be heard on rape charges.
The parliamentarian was allegedly disturbing public order by walking in a procession to the court and refusing to follow the route set by the authorities.
Sonko, a 46-year-old devout Muslim who is popular with youngsters, had been heading to court to face a charge that he says is politically motivated.
Hundreds of people followed his motorcade, sounding car horns and singing traditional songs.
But opposition supporters and security forces began to exchange rocks and tear gas canisters, and Sonko was arrested on charges of disturbing public order before he reached the court.
His arrest provoked some of the most serious clashes in the capital in years — with unrest reported in other cities in the country.
Nekhole Diatala, a supporter of the detained politician said: "We are here to support our leader, President Ousmane Sonko, but above all to fight for democracy, for freedom, for equality, for the rule of law, forever, we have been fighting."
Pape Moussa Seck, another supporter of Sonko, said: "We are dedicated young people and we want this change, and all they have to do is free us, we need freedom, that's it."
Sonko is the leader of the Pastef-Les Patriotes party —and placed third in the 2019 presidential election.
He is expected to be one of the main political opponents of the Senegalese government in the upcoming presidential vote scheduled for 2024.