A gangster was killed in a shootout between two gangs in the premises of a Gurgaon court on Friday, senior officials said.
The police then shot dead two of the three assailants.
Three persons opened fire on gangster Har Dutt, killing him on the spot, as he was brought to be produced before Additional District Sessions Judge R C Geodora in connection with a murder case.
Dutt, whose hands were tied, received five bullets and died on the spot, Inspector-General of Police Mohinder Lal said.
The police soon cornered one of the assailants, identified as Ravi Pandit, in a toilet, Lal said.
Pandit fired at the cops and was killed in the ensuing gun-battle.
Two other assailants, identified as Babloo and Jaiprakash, escaped from the scene, but Babloo was killed in an encounter in Sohna-Alwar Road in Badshahpur.
When cornered, Babloo opened fire at the police and in the retaliatory fire, he was hit by two bullets, Gurgaon Senior Superintendent of Police Haneif Khureshi said. He was immediately taken to the Gurgaon Civil Hospital where he was declared dead on arrival, Khureshi said.
Jaiprakash is absconding.
There were at least 16 cases, including charges of murder, pending against Dutt, a resident of Khandasa in Gurgaon.
Two different courts had sentenced Dutt's rivals for life on the charge of murder. They were out on parole in 2005 and have not returned to the prison, Lal said.
In March, Dutt's brother Deepak had allegedly attempted to kill Surender, an accomplice of Jai Prakesh.