Media playback is unsupported on your device Media caption David Loyn at the scene: "This is an Afghan response to an Afghan situation"

Afghan security forces have tackled heavily-armed militants who seized a building near the main airport in the capital Kabul.

Officials said seven gunmen had been killed in the five-storey building under construction near the airport and the attack was now over.

The Taliban earlier said that they carried out the assault.

The BBC's David Loyn at the scene says Afghan forces dealt with the situation with no help from international forces.

The incident began shortly after dawn on Monday with witnesses reporting the sound of explosions and gunfire coming from the airport.

Exchanges of fire went on for some hours with the Taliban firing rocket-propelled grenades into the surrounding streets.

Police say the attack on Kabul International Airport was well co-ordinated - as was the response by Afghan security forces. Soon after the insurgents opened fire with rocket-propelled grenades and heavy machine guns, Afghan security personnel shut down the airport to all incoming and outgoing flights. Elite police reacted swiftly, engaging the militants in a battle that lasted nearly three hours and left all seven attackers dead. The sound of exploding grenades and machine guns could be heard several kilometres away. But the attack left several unanswered questions: For example, how did the insurgents manage to get their heavy weapons and a vehicle loaded with explosives up to the airport's perimeter despite all the security in place? Some experts said the attackers wanted to convey the message that they can strike at will in Kabul. The authorities may be praised for their response - but the attack highlights another clear failure of intelligence.

All flights were cancelled in and out of Kabul international airport, which is home to a large Nato-led military base. Nearby roads were closed.

Our correspondent said US Blackhawk helicopters circled above but on the ground the fighting was all carried out by Afghan police and army units, who have become far better at combating the insurgency.

Embassies on alert

He said the Afghan police rapid reaction force sealed off the area and began clearing the building floor by floor.

Kabul police chief General Ayoub Salangi later said that seven attackers had been killed - two when they detonated their explosives and five who were killed by security forces.

He said there were no civilian or military casualties.

As the drama unfolded, embassies in the diplomatic area of Kabul were quickly locked down.

Reports said the US embassy had sounded its "duck and cover" alarm and announced on loudspeakers that the alarm was not a drill.

Alarms were also heard ringing loudly from the British embassy.

The Taliban announced a "spring offensive" in April, saying it would target foreign military bases and diplomatic areas.

Last month, Afghan security forces fought Taliban insurgents for hours in the centre of Kabul after a major explosion shook the city.

Most international troops are scheduled to leave Afghanistan by the end of 2014. Afghan forces are due to take responsibility for the security of the whole country in the next few months, for the first time since 1992.