Afghan police say seven insurgents were involved in Monday's pre-dawn attack at Kabul airport.
Their assault on an unfinished building next to the international airport site ignited a four-hour battle with security forces.
Police said five of the militants were killed in the fighting.
The other two were suicide bombers who blew themselves up.
Attacks on the heavily-guarded airport used by the military and civilians are relatively rare.
The assault could add to the growing fears over the ability of Afghanistan's own security forces to cope when most foreign combat troops leave next year.
But Afghan interior ministry spokesman Sediq Sediqi says Monday's attack showed how good they could be.
"Our forces today proved they can foil any kind of attack, especially those complex and difficult terrorist attacks like today. Seven of the terrorists came with weapons and RPGs (Rocket Propelled Grenades) and they again were hidden in this place but fortunately our police police force today, they are very strong, and within hours they killed all of them."
The Taliban claimed responsibility for Monday's assault which it said was part of a spring offensive.