Loyalist rioters attacked police vehicles with hatchets, knives and sledgehammers during trouble in east Belfast, the High Court heard on Monday.
Petrol bombs were also fired at PSNI lines in one of the most serious outbreaks of street violence linked to ongoing flag protests.
A judge was told how officers deployed baton rounds and a water cannon in a bid to control the mob behind the disorder.
Details were disclosed as bail was refused to a man accused of shoving a wheelie bin towards police.
Malcolm Stevenson, 46, of Templemore Street, Belfast, denies a charge of rioting in the Newtownards Road area on January 7.
On that date police learned through social media sites that a number of protests were to take place, the court heard.
In the largest, up to 500 people staged a demonstration outside City Hall, where the decision to restrict the flying of the union flag had been taken the previous month.
Although that protest passed off peacefully, trouble started on the return to east Belfast past the nationalist Short Strand.
Conor Maguire, prosecuting, said demonstrators were ushered down the Newtownards Road after bottles and masonry was thrown from that neighbourhood.
“At this stage protestors began to attack police lines,” he said.
“Throughout a prolonged period police vehicles were attacked with hatchets, large knives, sledgehammers, petrol bombs and fireworks.
“Large scale disorder developed and water cannon and plastic bullets were used.”
As the rioting intensified, burning barricades were used to block the road.
It was alleged that Stevenson was seen pushing a wheelie bin at a police vehicle which another man tried to strike with a stick or bar.
The accused was arrested and later taken to hospital for treatment to head wounds.
Stevenson claimed he was simply returning home when he unwittingly got caught up in the violence.
His barrister, Dennis Boyd, told the court: “The riot just kicked off in a big way, to use his words, and before he knew it he was in the middle of it and police had arrested him.
“He had been beaten and had to be taken to hospital to be stitched. He denies rioting.”
However, bail was refused due to the risk of further offences.
Mr Justice Stephens said: “The actions of those involved in such riots can impact seriously on people who are potentially injured and also others in the area.”
Two others accused of offences linked to the ongoing disorder in east Belfast we also ordered to remain in custody.
Stephen Thompson, 39, of Dunraven Park in the city, denies charges of disorderly behaviour, threats to kill and assault on police during trouble on January 4.
The court heard claims that he shouted at police that he would “separate and shoot them”.
It was also alleged that he tried to head-butt an arresting policeman, despite the officer wearing a public order helmet at the time.
The third suspect, David McDonnell, 44, of Emerald Street, Belfast, faces a charge charge of allegations of throwing a brick at a police Landrover.