Two attackers on motorcycles shot the unidentified judge early on Saturday while he was walking to work in Kandahar province's Panjwayi district, said District Chief Niaz Mohammed.
Police are investigating the shooting, but no arrests have been made, he said.
The attack came a day after a bomb attack killed district administrative official Mohammed Shafi in nearby Shah Wali Kot district, said provincial police chief Abdul Malik Khan.
Shafi was killed early on Friday when a remote-controlled mine exploded as he walked out of his house.
"The Taliban was responsible," Khan said. "Police will solve the case of this terrorist attack."
Election workers kidnapped
Three Afghan election workers have also been kidnapped by suspected Taliban or al-Qaida fighters in the northeastern province of Nooristan.
The abduction on Saturday is the latest in a series of violent incidents in the approach to the 18 September parliamentary polls.
The three men were seized from a villager's house three nights ago in Kamdesh district after the end of a registration programme in the rugged region, Mohammad Yusouf, secretary for Nooristan's governor, said.
"There were signs of blood in the house from where they were kidnapped and we do not know where they have been taken to," Yusouf said.
"We suspect al-Qaida or Taliban were behind the kidnappings," he said, adding a hunt had been launched to rescue the victims.