Taliban fighters have attacked Kabul's international airport, setting off explosions and trading gunfire with Afghan soldiers, as a major alert was raised in the capital.

Major Attacks in 2014 July 15 - 89 killed in country's eastern Paktika car bombing (Taliban denies claim) July 5 -Taliban torch 200 fuel tankers near Kabul June 25 - 800 Taliban rebels storm four districts of Helmand province May 12 - Taliban launch 'spring offensive', attack Kabul international airport Mar 29 - Taliban attack foreign guesthouse in Kabul Feb 23 - Taliban ambush kills 21 Afghan troops Jan 20 - Several suicide bombers damage helicopters and drones stationed in Afghan-NATO air base in Kandahar

A rapid response force was sent to the airport by the Afghan military after an explosion and bursts of gunfire were heard on Thursday morning.

The Taliban said that it had carried out the attack.

The AFP and Reuters news agencies reported security sources as saying the fighting ended at about 5am GMT, with the deaths of all attackers.

"Four terrorists were killed by police special forces. The area is being cleared now, there are no casualties to our forces," said Sediq Sediqqi, a spokesman for the interior ministry, told Reuters.

He said that no Afghan soldiers were killed in the attack.

Witnesses said the fighers fired rockets from a number of buildings near the airport.

Jennifer Glasse, Al Jazeera's correspondent in Kabul, said: "We've heard at least two dozen explosions and a lot of gunfire. Fighter jets are circling the airport.

"There's a civilian side and a military side to the airport that houses Afghan security forces and NATO forces, the attack it seems to be targeting that side.

"This attack calls security into question. If this many fighters can get into such a secure facility, and a secure area of the airport, it raises questions as to how so many can get through a heavily fortified building.

"There are high rise buildings being built around the airport and that seems to be what has made the airport vulnerable."

A Kabul airport official told the Reuters news agency all flights had been diverted to other cities.

The attack comes at a time of great uncertainty as votes from the second round of a disputed presidential election are due to be recounted.

The poll is meant to mark Afghanistan's first democratic transfer of power.