Rahul Singh and Chandra Prakash, lodged in the district jail here, were taken to the court in connection with hearing of a case and were lodged in the lock up there, additional SP, Rahul said.
The two clashed with each other over some matter following which Rahul fired at Chandra, ASP said.
Chandra received bullet injuries on his shoulder and had been admitted to hospital.
Investigations were on as to how the inmate got hold of the firearm, the ASP added.