The victim, Vinod, who was being tried in a cheating case, was shot while being escorted into the court premises around 11:20 a.m. He was being produced in the court by the staff of Third Battalion.
The accused said that he was hired by someone else to murder the prisoner. The accused, Abdul Khan (24), was arrested from the spot and the weapon of offence seized, he said.
The incident has raised questions over the security of the court as to how the attacker managed to sneak into the court complex with a gun.
According to the police, the incident took place at around 11.40 am.
Meanwhile, the in-charge of the Rohini police post, sub-inspector Narender, has been placed under suspension and Ashok Kumar, Station House Officer (SHO), Prashant Vihar police station, has been sent to district lines.
Shawn Mendes, Eminem among winners at MTV EMAs in London
U2, who played an MTV-sponsored concert in London's Trafalgar Square on Saturday, received the Global Icon award from Leto, who said "U2 changed my life".
During investigation, it was revealed that Vinod was the resident of Mangolpuri area, whereas Abdul Khan was residing in Nangloi.
He said police were also looking into security lapses in the incident.
Quoting eyewitnesses and police officers who were escorting him, the senior officer said Khan was overpowered by police officers after the shooting. He was rushed to a nearby hospital where he was declared brought dead, reported NDTV.
In 2015, three juveniles barged into a courtroom at Karkardooma court complex and shot at an undertrial, injuring him critically and leaving a constable in his security dead on the spot. The police is investigating and more details are awaited. He had been absconding for the past seven years in a cheating case registered at the south Rohini police station in 2010, over a sale of a plot there.
Sources said that Khan might have been hired by the businessman who was duped by the deceased.