Kabul, Afghanistan (BBN)-Heavily armed militants who attacked Kabul International Airport with grenades and automatic weapons have been repelled, Afghan officials say.

The four insurgents who took part are dead, the authorities said, with one security official wounded.

The Taliban said they carried out Thursday morning's attack which lasted for nearly five hours.

Deputy Interior Minister for Security Mohammad Ayub Salangi said the area was "completely cleared".

"The last insurgent has just blown himself up, because he knew [Afghan forces] were on the way to capture him," he said.

Eyewitnesses said the militants took over an unused under-construction building near the heavily guarded airport.

All flights from the airport were diverted to other Afghan cities.

The militants are believed to have used a car bomb to gain access to the building, says the BBC's Karen Allen in Kabul.

Afghan police and special forces engaged the militants in buildings near the airport.

An interior ministry official told the BBC that the airport itself had not been damaged in the attack, claiming "not a single rocket" had landed inside.

Meanwhile, Afghan TV has reported that President Karzai's security team has been ambushed in Zurmat, on its way to Paktika Province in the east of the country, where 42 people were killed in a suicide attack two days ago.

An unconfirmed number of people have been wounded and captured.

The airport attack came as Afghanistan began an official audit of all votes in the disputed results of last month's presidential election.

The two presidential contenders, Abdullah Abdullah and Ashraf Ghani, agreed earlier this week that they would accept the outcome of the audit as final, to resolve their dispute.

President Obama says that if the two candidates keep their commitments, Afghanistan will witness its first democratic transfer of power.

The audit is expected to take up to four weeks.

BBN/SS-17July14-3:40pm (BST)