Prisoner Wahid Noor Khan died in the explosion in Sopore town of North Kashmir, police sources said, adding constable Abdul Majid, who was injured in the blast, succumbed at a hospital during treatment.
Sources said Khan, who was produced before a sessions court, was handed over two grenades in the court complex.
They said that the grenades were supposed to be either carried by Khan to the central jail or in a bid to make an escape.
Khan was arrested in connection with a militancy-related case of 2010.
The four injured policemen were admitted to SKIMS hospital here.