Two prisoners have died and 14 people have been injured in a shoot-out in the Pakistani city of Sukkur.
The incident occurred when some 80 prisoners were transferred from Sukkur Central Prison for a court hearing in Nowshehr Feroz in Sindh province.
Police sources say a police guard shot one of them in the head in an apparent revenge killing.
The guard believed the prisoner had killed two members of his family, the sources say.
As the handcuffed prisoners were being offloaded from a van, the guard shot Sarwar Rind in the head and killed him on the spot, the sources say.
He did so in revenge for the fact that Sarwar Rind had killed two of his brothers several years ago, they say.
Court violence
The BBC's Ali Hassan in Hyderabad says immediately after the shooting, the prisoners rioted, hurling stones and rocks at police.
One prisoner got hold of a police rifle, and opened fire indiscriminately.
Our correspondent says out-of-control prisoners then started to roam round the court building, terrorising judges, lawyers and court officials.
Another prisoner is reported to have been killed in the ensuing violence, and 14 policemen and prisoners were injured.
The general secretary of the local bar association, Abdul Ghafoor Kalhoro, told the BBC that in the end, a court official managed to calm the prisoners down.
He said they agreed to surrender on condition that they would not be physically abused by the police when they were back in custody.
But in the confusion, 10 prisoners managed to escape.
Security arrangements within the court premises are being reviewed as a result of the incident.