(Changes dateline from ISLAMABAD, adds comments from interior minister)
By Syed Raza Hassan
KARACHI, Pakistan, June 9 (Reuters) - Taliban militants disguised as security forces stormed into Pakistan's busiest airport on Sunday night, triggering an all-night battle in which at least 27 people were killed.
The assault on Jinnah International Airport in Karachi, Pakistan's sprawling commercial hub of 18 million people, all but destroys prospects for peace talks between the Pakistani Taliban and the government of Prime Minister Nawaz Sharif.
It deals a heavy blow to Sharif's efforts to attract foreign investors to revive economic growth, and raises questions about security at Pakistan's main installations.
Shahidullah Shahid, a Taliban spokesman, said: "The main goal of this attack was to damage the government, including by hijacking planes and destroying state installations."
Just before midnight, 10 gunmen in military uniforms armed with automatic rifles and rocket-propelled grenades arrived at the cargo terminal in two minivans, then shot their way in.
The militants split into two groups, with one attacking a gate called Fokker to create a diversion, and the other trying to take over the cargo terminal, police said.
"They operated in pairs. That's why their bodies were found lying in pairs," said senior police officer Raja Umar Khattab. He said the militants had fired rockets at passenger planes but missed. "It seems there was some ill-planning on their part."
Passengers were evacuated and all flights were diverted. Officials said no aircraft had been damaged.
Gun battles went on for five hours until security forces regained control of the airport at dawn, and television pictures showed fire raging as ambulances ferried casualties away.
Another security source said the militants were highly trained and had carried large backpacks filled with dried fruit and water, suggesting they were in for a long siege.
At least three loud explosions were heard, apparently from militants wearing suicide belts blowing themselves up.
A spokesman for the paramilitary Rangers said a large cache of arms and ammunition had been recovered from the militants, and the government said security was being stepped up at all airports.
"We need to keep extremely vigilant," said Shujaat Azeem, special assistant to Sharif on aviation.
The Pakistani Taliban, an alliance of insurgent groups fighting to topple the government and set up a sharia state, said they had carried out the attack in response to air strikes on their strongholds near the Afghan border.
Interior Minister Chaudhry Nissar Ali Khan told reporters in Karachi late on Monday that the militants' apparent aim was to "damage the airport and planes as well as carry out a hostage taking". "They had come prepared for the long haul," he said.
Almost 24 hours after the initial attack, black smoke was still billowing above the airport and security was tight, according to a Reuters reporter at the scene.
"At the time of the attack, two planes with passengers were parked near the runway. Fortunately, all the passengers were safely taken to the lounge," Chaudhry said. "Pakistan is a conflict zone, so the threat is everywhere."
The Rangers said that the attackers were ethnic Uzbeks. Pakistani officials often accuse foreign militants holed up in lawless areas on the Afghan border of staging attacks alongside the Pakistani Taliban.
"Three militants blew themselves up and seven were killed by security forces," Rizwan Akhtar, regional head of the Rangers, said in televised remarks. "The militants appear to be Uzbek."
The death toll included airport security guards and workers with Pakistan International Airlines.
In separate, unrelated violence, 24 Shi'ite Muslim pilgrims were killed in a suicide attack near Pakistan's border with Iran, an official said. A radical Sunni Islamist group claimed responsibility.
A suspected Taliban suicide bomber also rammed a truck into a military checkpoint on the border with Afghanistan, killing four soldiers, military officials said.
Sharif came to power last year promising to find a negotiated solution to years of violence but, after the attack on the airport, the peace process looked in trouble.
Karachi is Pakistan's biggest city and home to a vibrant stock exchange, the central bank and the country's main port. But it is also a violent and chaotic place, where Taliban militants and criminal gangs operate freely underground.
Peace talks between the government and the Pakistani Taliban had been failing in recent months, already dampening hopes of a negotiated settlement. (Writing by Maria Golovnina; Additional reporting by Gul Yousufzai in QUETTA, Haji Mujtaba in MIRANSHAH and Mehreen Zahra-Malik in ISLAMABAD; Editing by Kevin Liffey)