Abdul Latif Afridi, a former president of Pakistan's lawyers union and a human rights activist, was shot multiple times and pronounced dead at a nearby hospital, according to police.
"The killer, a junior lawyer who was wearing his gown, opened fire at close range and then handed himself over to the police," said Ijaz Khan, a senior police official.
A legal assistant, Muhammad Rizwan, who witnessed the shooting, said the attacker told police: "don't shoot, I had a feud with him and I have taken my revenge," before being arrested.
The attacker had reportedly previously accused Afridi of orchestrating the killing of his father.
Pakistan prime minister pays tribute
Pakistan Prime Minister Shehbaz Sharif condemned the killing.
In a statement he described Afridi, who also served in the national assembly in the 1990s, as "a seasoned jurist and a brave politician who was known for his righteousness."
Sharif also expressed concern over the deteriorating security situation in northwestern Khyber Pakhtunkhwa province, where Peshawar is the capital.