At least 23 people have been killed, including all 10 of the attackers after gunmen attacked one of Pakistan's biggest airports.

The attack on Jinnah International Airport in Karachi, took place as Prime Minister Nawaz Sharif's government tries to engage Pakistani Taliban militants in negotiations to end years of fighting.

Gun battles went on for several hours and television pictures showed fire raging at the airport as ambulances ferried casualties away, but by the army has said the airport has now been secured.

There was no immediate claim of responsibility, but Pakistani Taliban militants, allied with but separate from the Afghan Taliban, are battling to overthrow the Pakistani state and impose their hardline vision of Islamist rule.

Earlier, officials said all flights had been diverted.

Peace talks between the government and the Pakistani Taliban have failed in recent months, dampening hopes of reaching a negotiated settlement with the insurgency, which continues attacks against government and security targets.