The judge headed the appellate court in eastern Laghman province and was killed in neighboring Nangarhar, 150 kilometers from the capital.
"Neighboring province's appellate judge Mahmood-ul-Hassan was killed while his two children were injured at 8:00 am local time following a sticky bomb blast attached to his vehicle. He was traveling to his office when the blast took place," provincial police spokesman Hazrat Hussain Mashriqiwal told The Anadolu Agency.
He said other casualties were avoided because the blast occurred early in the morning. The bomb was so powerful it split the car apart.
Taliban fighters, who have been fighting against the Afghan government since 2001, claimed responsibility for the attack.
The Taliban have been targeting members of the judiciary in recent years in an effort to create a void in villages and remote areas of the country that can be filled with the Taliban's own parallel justice system.
After NATO-led international security service members and Afghan troops, judges and prosecutors have been the main targets for Taliban attacks.
They claim corruption within the system and death sentences for militants, handed down by the judges, justify their targeted killings.
In a fatal attack in Oct. 2014, at least six prosecutors were killed and nine others were wounded when a group of Taliban suicide bombers and gunmen stormed a provincial court while the trial of a number of militants was underway.
In December, unknown gunmen in capital Kabul killed Atiquallah Raufi, head of the Afghan Supreme Court secretariat, which the Taliban later claimed was a revenge attack.
Corruption paired with a weak judicial system in the country's remote areas have led people to lose faith in the government, amid growing insecurity in Afghanistan, and the Taliban's system of parallel courts are filling the vacuum.
The Taliban insurgents have established their own parallel judicial system in Afghanistan either to show their presence and control over the rugged mountainous country or to win the hearts of people who are tired of corrupt judicial system and officials.
Despite the Taliban's harsh rulings on crimes and disputes among people, they are often welcomed by locals.
International watchdogs, including Amnesty International, have also criticized the Afghan justice system, saying it does not meet international standards of fair justice and is hampered by corruption.