The Afghan Defence Ministry in a statement said no one was killed or injured by the magnetic bomb which was attached to an army truck.
It said that the explosion happened at 8:20 a.m. when the vehicle was entering the Defence Ministry compound.
There was no immediate claim of responsibility for the bombing.
The blast in Kabul comes less than a week after a suicide attacker killed 20 people and injured dozens more outside Supreme Court in the city.
The ISIS terrorist group claimed credit for that attack.