An eyewitness told the BBC that about 50 supporters of President Rajapaksa had confronted opposition supporters and attacked them with stones and bottles.
The BBC's Charles Haviland in Colombo says opposition activists ran away and then returned attacking in their turn - whereupon the police used tear gas to drive people away.
Fonseka supporters said "government thugs" had attacked a peaceful protest.
"They stoned us and attacked with clubs and even threw glass bottles at us in front of the police," one woman told Reuters news agency.
Gen Fonseka lost presidential elections last month
Earlier, Gen Fonseka's wife, Anoma, was allowed to visit him in detention at navy headquarters.
She has now filed a petition at the Supreme Court claiming his arrest is illegal. It will be heard on Friday.
Mrs Fonseka has named as respondents the defence secretary, the new army chief and the senior officer present on Monday night when her husband was forcibly dragged into detention, our correspondent says.
In a joint statement, the opposition parties have said they fear Gen Fonseka may be killed in detention.
A government spokesman has been reported as saying there is tangible evidence to back up the authorities' allegations against the general, which include the accusation that he worked with politicians against the government while still in the forces.
He denies all wrongdoing.
Mr Rajapaksa easily defeated Gen Fonseka in elections last month, but the general rejected the outcome.
The two men both claimed credit for the defeat of the Tamil Tigers last year but fell out soon after the fighting ended.
This page is best viewed in an up-to-date web browser with style sheets (CSS) enabled. While you will be able to view the content of this page in your current browser, you will not be able to get the full visual experience. Please consider upgrading your browser software or enabling style sheets (CSS) if you are able to do so.