It was one of three attacks on state facilities in the morning by insurgents around the country.
Another six militants wearing suicide bomb vests tried to storm the provincial council building in the capital of southern Zabul province, while three attempted to attack a district police headquarters just outside Kabul.
Interior Ministry spokesman Sediq Sediqi said that in Zabul they managed to wound 18 people, including three police officers, when they detonated a car bomb outside the building in the city of Qalat, but security forces shot and killed them before they managed to enter. On the outskirts of Kabul, police killed one attacker and arrested two others who tried to storm the headquarters building in the Surobi district.
In the capital, it was the third time in a month that insurgents have launched a major attack seeking high-profile targets, part of an effort to rattle public confidence as Afghan security forces take over most responsibility for protecting the country ahead of the withdrawal of foreign troops next year.
Afghan President Hamid Karzai said his government would not be deterred by the attacks.
"These cowardly terrorist attacks on the Afghan people cannot change the chosen path of the Afghan people toward progress, development, peace and elections," Karzai said, referring to next spring's poll to elect a new head of state.
Karzai was not in Kabul during the attack, but was visiting the Gulf state of Qatar, where he was discussing his country's stalled peace process and the possible opening of a Taliban office in Doha.
Both Afghanistan and the United States support the opening of a Taliban political office in Qatar as part of an effort to rekindle talks with the insurgent group, which has been waging war against the government and U.S.-led military coalition for nearly 12 years. But first, Kabul and Washington say, the Taliban must renounce all ties to al-Qaida and other terrorist groups and accept Afghanistan's constitution.
Sediqi said the attacks are motivated by the upcoming handover of the lead for security from the U.S.-led coalition to the Afghan army and police. Afghan forces are now leading 90 percent of the military operations against the insurgents and have the lead for security in areas where 80 percent of the country's population lives. After the handover sometime later this month, the coalition will assist, train and mentor and only provide military support in emergencies.
"Of course, in the coming days, there will be a transition and security is going to be handed over to Afghan forces," Sediqi said. "They are trying to sabotage that process and trying to bring the ability of the Afghan security forces into question, which they cannot because today's incidents in three different parts of the country were all foiled without significant casualties."
He added that in the Kabul attack there was no need to "call coalition support because, you know, today the Afghan forces, especially police and special units, foiled the attack."
The Kabul airport itself was not damaged and reopened shortly after the fighting was over, said airport chief Yaqub Rassuli.
"There was no damage to the runway. Some shrapnel fell nearby, but we have cleared it away," Rassuli said.
Police said that attackers wearing suicide vests occupied one or two buildings under construction on the west side of the airport and began firing at the NATO facility, which was quite a distance away. It was unclear whether they hit anything inside that facility.
Kabul police chief Ayoub Salangi said a mini-van full of explosives parked outside the building in an effort to kill security forces did not blow up and was later safely detonated.
Two Afghan civilians were wounded, but there were no deaths among either security forces or civilians, Sediqi said.
Taliban spokesman Zabiullah Mujahid claimed responsibility for the attack, saying the insurgents were targeting NATO headquarters.
The international military coalition said it was assessing the situation and had no immediate reports of casualties or damage. The U.S.-led NATO coalition's Joint Command headquarters at the airport runs the day-to-day operations of the nearly 12-year-old war against insurgents. The airport's military side is also used for NATO transport and other aircraft.
The attack began with a loud blast at around 4:30 a.m.
"It started just after dawn prayers and I counted about a dozen explosions, mostly RPG fire, coming from (near) the airport," said Emayatullah, who lives next to the airport. Like many Afghans he uses only one name.
Kabul police spokesman Hashmat Stanikzai said that after the initial blast, at least five insurgents then occupied two buildings, located in a single compound, and started firing rocket-propelled grenades and automatic weapons.
"Sometimes they are shooting from one building, sometimes from other," he said during the fighting. "It is a residential area and the compound has been surrounded by Afghan security forces. The security forces surrounded the buildings and are being careful because it is a residential area."
Deputy Kabul police chief Dawood Amin says there were seven attackers in total. Two blew themselves up with suicide vests at the start of the assault and five were shot and killed by police during the battle.
The Taliban have launched intense attacks across the country, testing Afghan security forces as foreign combat troops pull back more than a decade after the U.S.-led invasion to oust the Taliban regime for sheltering al-Qaida's leadership after the Islamic extremist group launched the Sept. 11, 2001, terrorist attacks in the United States.
The last big attack in Kabul was May 24, when six suicide bombers attacked a guest house belonging to the United Nations-affiliated International Organization for Migration, killing three people - including a police officer, a guard and a civilian. On May 16, a suicide bomber had rammed a car into a NATO convoy killing 15 people, including two American soldiers and four civilian contractors.___
Associated Press writer Amir Shah contributed from Kabul.