President Ashraf Ghani has awarded an Afghan soldier with a new home for killing militants who tried to storm parliament.

Greeting Sergeant Essa Khan at his office on June 23, Ghani said he was proud of the soldier's "resolve and heroism."

Twenty-eight-year-old Khan catapulted to fame following a June 22 attack on the parliament building that killed six civilians and left all seven presumed Taliban attackers dead.

In a video broadcast on national television of the immediate aftermath of the assault, Khan stands over the bodies of the Taliban attackers and claims he has single-handedly killed six militants shortly after another attacker blew himself up.

His account was disputed by some, who said he had shot and killed three of the militants.

But the Defense Ministry confirmed Khan's claim and hailed him as "the pride of Afghanistan's defense and security forces."