At least four undertrial prisoners were gunned down on Saturday at a court in the adjacent garrison town of Rawalpindi, police and eyewitnesses said.
Another man was injured in the incident, Xinhua reported citing Geo TV.
All the victims were suspects in a murder case and were in police custody, the report said.
The incident took place around 11 am when four unidentified gunmen opened fire at the suspects brought to the court by police.
The gunmen fired just after the suspects stepped out of a police van, a witness said.
Three died on the spot while the fourth died on his way to a hospital, a source said. All four were involved in a murder case.
Three attackers fled on a motorcycle after the shooting while one was arrested.
Another media report quoted sources as saying that the four suspects were members of a family which had a dispute with another family. They had received threats even when they were in police custody.