Afghan insurgents staged a pre-dawn attack on Kabul International Airport on Thursday, firing rocket-propelled grenades from a nearby building and engaging in a gun battle with security forces, officials here said.

Kabul Police Chief Mohammed Zahir Zahir told the Associated Press later Thursday that four of the attackers were killed and that the attack was halted without any civilian or police casualties.

The airport was later reopened and operations returned to normal, Zahir said, after security forces inspected the runways for shrapnel and explosives.

At least a dozen explosions and the sound of heavy gunfire could be heard across the Afghan capital beginning around 4:30 a.m. Thursday. Fighter jets were also seen flying above the city.

An airport official told the Reuters news agency that all flights had been diverted to other cities while security forces fought off the insurgents. Kabul’s international airport is used by both civilians and the military, and it hosts a NATO air base and a number of Afghan military aircraft.

The Taliban asserted responsibility for the attack in a statement issued by spokesman Zabiullah Mujahid, local media reported.

The attackers invaded an unfinished building close to the airport runway, using the construction site to launch the raid, the Interior Ministry said. Witnesses reported seeing large plumes of smoke rising above the district where the airport is located, roughly 10 miles from central Kabul.

Interior Ministry spokesman Sediq Sediqqi said a rapid-response force had been deployed to the Qasaba area next to the airport.

“The terrorists in Qasaba are surrounded by security forces and will be killed soon,” Sediqqi posted on his official Twitter account. He said there were no casualties and no damage to the airport.

But the assault underlined the mounting security woes that Afghan forces face as foreign troops are scheduled to leaveby the end of the year. The fractured political landscape, too, has raised concerns about the stability of the country following a U.S. withdrawal.

Afghan electoral institutions are set to begin a nationwide recount of the 8 million votes cast in a presidential runoff election last month that was marred by widespread fraud. The dispute between the two candidates over the results threatened to splinter the country along ethnic lines.

Secretary of State John F. Kerry came to Kabul last week to broker a deal to resolve the impasse.

Sayed Salahuddin contributed to this report.