KARACHI, Pakistan — Pakistan’s military spokesman declared an end to a six-hour long operation following a militant siege of Pakistan’s busiest airport in the southern city of Karachi Monday, with at least 21 dead, including 10 militants.

“Update: Area cleared. No damage to aircraft, fire visible in pics was not plane but a building, now extinguished. All vital assets intact,” said Major General Asim Bajwa.

Earlier Sunday night, heavily armed militants, reportedly dressed as policemen, attacked Pakistan’s busiest airport in Karachi as flights were suspended and the army was called in, officials said.

Some militants were also killed in the assault as gunfire, which continued overnight, and two huge blasts rocked the Jinnah International airport.

The raid prompted fears of the kind of prolonged siege which followed similar attacks on key installations in recent years.

Gunmen attacked the terminal late Sunday, said Shaukat Jamal, a spokesman for the Airport Security Force, an arm of the country’s police. A major fire rose from the airport, with the silhouette of jets seen.

Jamal said the Pakistani military had been called in and that police were fighting the attackers.

The attack happened at a terminal not generally used for commercial flights but for special VIP flights and for cargo.

“I was working at my office when I heard big blasts — several blasts — and then there were heavy gunshots,” Sarmad Hussain, a PIA employee, told The Associated Press after escaping the building. He said he and a colleague jumped out of a window to get away, and his colleague broke his leg.

When Hussain came out of the building, he said he saw smoke billowing from the terminal.

Jamal, the ASF official, said army commandos confined the attackers to a maintenance area, and that they hadn’t been able to get onto the tarmac.

An official who spoke to journalists near the airport said at least some of the militants were wearing Airport Security Force uniforms and all were strapped with explosives. He said one of them tried to capture a vehicle used by the Civil Aviation Authority and when a guard shot at him, the explosives strapped to his body went off. The official said another attacker also blew up after being shot at by security forces.

He said he had seen the bodies of three attackers and that an additional three or four attackers were believed to be alive. The official described himself as being with one of the country’s intelligence agencies but declined to give his name.

The country’s military said in a statement that all the passengers had been evacuated and that three gunmen had been killed.

At least two domestic flights have been diverted and all flight operations had been suspended at the airport. A spokesman for the Civil Aviation Authority said the airport would be closed until at least Monday night.

Karachi is Pakistan’s largest city and has been the site of frequent militant attacks in the past. It is the country’s economic heart and any militant activity targeting the airport likely would strike a heavy blow at foreign investment in the country.

In May 2011, militants waged an 18-hour siege at a naval base in Karachi, killing 10 people in an assault that deeply embarrassed its armed forces.

There was no immediate claim of responsibility for Sunday night’s attack. Pakistan’s government has been trying to negotiate a peace deal with local Taliban fighters and other militants mostly based in the northwest who have been waging war against the government. But the talks have had little success, raising fears of a backlash of attacks across the country.

Security officials in Karachi had feared that if the talks broke down, their city would be a likely spot for militant groups to strike back as the Pakistani Taliban and their allies increasingly have gained a foothold in the city in recent years.