Over 80 undertrial prisoners were stuck at the Tis Hazari Court after lawyers and police clashed over a parking dispute in the complex.
The undertrials, who had come for hearing, had to be put in lock up rooms till evening, a senior police officer said.
At around 6pm, when the situation was brought under control, a human chain was formed and all the undertrials were safely shifted to Tihar jail, he said.
Lawyers and police clashed at the Tis Hazari Court complex during which at least 20 police personnel and several lawyers were injured while many vehicles set on fire, according to officials.
The complex turned into a virtual battleground after an argument between advocates and police over a minor accident turned violent.
Two station house officers (SHOs) and an additional commissioner were among the 20 personnel injured, police said and claimed that eight lawyers were hurt in the incident.
Lawyers, however, said more of their colleagues were injured than the number claimed by police. They also claimed that two advocates were injured in police firing, but police said they fired in the air.
Twelve motorcycles and nine police vehicles, including one of the Uttar Pradesh Police, were vandalised, officials said.