Ram Iqbal Ravidas, 40, was fired upon in front of the gate of the juvenile court where he was to produce the undertrial for the determination of his age, Vaishali Superintendent of Police, Vivek Kumar said.
The Superintendent of Police said Ravidas received three bullet injuries and died on his way to a hospital even as the undertrial escaped on the motorcycle which was being driven by the unidentified attacker.
The assailant also fired a few gunshots in the air to scare the onlookers, the SP said.
The undertrial was in jail in connection with a case of loot and although he appeared to be in his 20s, he had stated his age to be less than 18 years because of which he was to be produced before the juvenile court, police inspector in-charge of the area, Sunil Kumar, said.
Raids were on to arrest the attacker and also the undertrial who fled from custody, the SP said.