According to officials, two undertrials - Deepak Kumar, an accused in a robbery case and another person named Mohit - had been brought from the Ambala Jail to the General Hospital in Panchkula for treatment.
However, three miscreants who came to the hospital, used chilly powder on the staff and policemen escorting the undertrials, opened fire and freed Deepak Kumar from custody, the police said.
The second undertrial Mohit was still in custody, they added.
"Three armed men threw chilli powder on policemen. Gunshots were fired. They escaped after whisking away one of the undertrials. The policemen chased them and there was a scuffle also," a police official said.
In the ensuing melee, five people, including three nurses, fell unconscious and are being treated at the hospital, the police said.
One of the constables was manhandled during the scuffle, the police added.