Officials said five Ukrainians, three Chinese and one Russian were killed in the attack on Saturday night. A dual American-Chinese citizen was among the dead.

Another Chinese tourist survived the raid at the base camp of Nanga Parbat, the ninth highest mountain in the world at 26,660ft, in an area renowned for its breathtaking Himalayan scenery and world-class trekking.

Both the Pakistan Taliban, an umbrella militant group, and a sectarian Sunni group linked to the Taliban both claimed responsibility.

Ehsanullah Ehsan, a spokesman for the Pakistan Taliban, said the movement had set up a cell to target foreigners.

He said the operation was carried out in revenge for the death of Wali-ur-Rehman, the group's second in command who was killed by a US drone strike last month.

"This operation was also in reaction to the continuing drone attacks by the US," he added. "The foreign tourists were targeted so that we could get our protests heard at the international level."

Police officers in Gilgit-Baltistan said the gunmen wore uniforms of the Frontier Constabulary, the local security force.

Eyewitnesses counted a dozen militants in the attack on the tented camp, several hours' trek from the nearest road in an area not previously associated with violence or Islamist militancy.

They woke the tourists shortly after midnight and beat local staff before opening fire on the foreigners.

The attackers checked the identities of Pakistanis with the group and killed one, possibly because he was a member of the minority Shia community.

The attack will jeopardise future foreign expeditions to a country known for the presence of al-Qaeda, the Taliban and several home grown terrorist organisations.

Gilgit-Baltistan borders China and Kashmir and is considered one of the safer areas of Pakistan.

It is renowned for its natural beauty and views across the western edge of the Himalayas make it a popular destination for a small number of foreign walkers and climbers. It also attracts visitors from the international diplomats and aid workers based in Islamabad.

However, the area has been affected by sectarian violence in recent years with extremists targeting members of the Shia community.

Last year, the Pakistan military airlifted 120 foreign tourists from the area after they became stranded amid a wave of violence.

Nawaz Sharif, the prime minister, extended his sympathies to the families of the victims.

"Such acts of cruelty and inhumanity would not be tolerated and every effort would be made to make Pakistan a safe place for tourists," said a statement issued by his office.

Mr Sharif, who took office earlier this month after winning historic elections, faces a daunting array of problems ranging from a moribund economy to Taliban militancy.

The Pakistani government also issued a separate statement condemning the attack.

"Those who have committed this heinous crime seem to be attempting to disrupt the growing relations of Pakistan with China and other friendly countries," it said in a statement.