Get breaking news alerts and special reports. The news and stories that matter, delivered weekday mornings.

KABUL, Afghanistan — A soldier was lauded as Afghanistan’s newest national hero Tuesday after claiming to shoot dead all six gunmen involved in an attack targeting the parliament building.

Lance Corporal Esa Khan, 28, was on perimeter duty when a car bomb exploded at the gates of the Kabul site as lawmakers convened to appoint a new defense minister.

The Morning Rundown Get a head start on the morning's top stories. This site is protected by recaptcha

He recounted spotting the militants trying to enter the parliament "one by one."

"I killed all six of them," Khan told local TV in the attack's aftermath. "Their bodies are there, everybody can see them."

In a statement, the Ministry of Defense said: "Esa Khan fought bravely against the terrorists and using his military training and experience he managed to kill all six terrorists and prevent a tragedy."

President Ashraf Ghani tweeted on Tuesday that he met with Khan and gave him keys to a new apartment in Kabul in return for his bravery. He also ordered defense officials to award Khan a medal and to promote him.

I've invited our hero, Mr. Esa Khan to my office. I'm so proud of his resolve and heroism. Awarded him a new home. pic.twitter.com/V07ZWkVmxR — Ashraf Ghani (@ashrafghani) June 23, 2015

After being honorably discharged following three years in the army, Khan had returned to active duty "because of the love he had for his country" and was recently assigned to a task force tasked with protecting the parliament, according to the Ministry of Defense.

The Taliban claimed responsibility for the attack, which injured more than 30 people.

Sarah Burke reported from London.