Gangs of youths attacked police officers after an anti-racist march in east London, Scotland Yard said.
Cordons were set up to stop people going up Whitechapel Road because officers feared random attacks on members of the public.
The scenes followed a march, organised by Unite Against Fascism (UAF), that attracted several thousand people.
It was in response to a rally planned by the English Defence League (EDL), but called off earlier this week.
A police spokesman said the UAF rally had been "well organised and well stewarded" but a group of young men gathered outside the nearby East London Mosque in response to rumours the EDL was planning a protest.
He said: "The group numbered up to 300, who were very volatile.
"Despite continued excellent attempts by stewards and representatives from the East London Mosque to control the crowds, even placing themselves in danger, there was the risk of serious disorder.
"Police officers were attacked by the crowd at points throughout the afternoon.
"One member of the public was attacked at random by members of the crowd as those gathered surged up and down the Whitechapel Road.
"In order to prevent injuries to the public and officers, and serious disorder, police withdrew from the immediate area and a series of filter cordons were put in place."
One person was arrested for assault.
A UAF spokesman said about 5,000 had taken part in the march from Stepney to Whitechapel, which its website said was to "counter the threat of the BNP [British National Party] and EDL".
He said: "I heard there were a few nasty scuffles between local youths and police but certainly the demo was very positive and [had] a really good vibe."