Attaullah Khogyani, spokesman for the governor of Wardak province, says four militants launched the attack today on the court compound of the provincial capital Maydan Shahr, 40 kilometers (25 miles) east of the capital.
One of the attackers detonated explosives carried on his body while the other three exchanged fire with police, he says, adding that all four attackers were killed.
No one claimed responsibility for the attack.
The attack comes amid intensified fighting across many parts of Afghanistan since the Taliban launched their warm weather offensive a month ago.