The bomb went off while Hamidullah Khan, a prosecutor in Shirin Tagab, a district near the border with Turkmenistan, was on his way to work, said Baryalay Basharyar, the deputy police chief in Faryab province.
No one immediately claimed responsibility for the attack, though Basharyar blamed the Taliban.
Judicial officials have come under increasing attacks by Taliban insurgents, who are fighting to overthrow the government.
Suicide bombers attacked Justice Ministry employees in Kabul at least three times in recent months.
Abdul Manan Raoufi, the spokesman for the provincial police chief, said the floods earlier this week had also destroyed some home and hundreds of livestock.
