A Pakistani military helicopter crashed Friday, killing seven people including the Norwegian and Philippine envoys and setting a school building ablaze in a remote northern valley.

The Pakistani Taliban later claimed to have struck the aircraft with a ground-to-air missile hoping to assassinate Prime Minister Nawaz Sharif who was flying to the region at the same time -- but the claim was rebutted by officials and multiple eye-witnesses, including foreign secretary Aizaz Ahmad Chaudhry.

The helicopter was one of three carrying a delegation of ambassadors to inspect projects on a three-day trip to Gilgit-Baltistan where they were set to meet with Sharif.

The military and Pakistan's foreign office said the crash was due to a technical fault while landing. Officials added the school was shut at the time.

"The matter will be investigated as initial reports suggest it was a technical fault," the Ministry of Defence said in a statement.

Leif H. Larsen, the Norwegian envoy, and Domingo D. Lucenario Jr of the Philippines were killed along with the wives of the Malaysian and Indonesian ambassadors, the helicopter's two pilots and another crew member, according to tweets from an official army account. The Norway and Philippines foreign offices confirmed the deaths of their diplomats.

The Indonesian foreign ministry in a statement confirmed the death of the ambassador's wife, Heri Listyawati Burhan Muhammad, but said that Ambassador Burhan Muhammad was safe, though injured.

A statement from Sharif's office said he was on a plane en route to the Gilgit area at the time of the incident, but turned back to Islamabad after news of the crash broke.

He was due to inaugurate a chair-lift at a ski resort, one of the region's top administrative officials told AFP.

The prime minister "expressed deep grief and sorrow" and announced a day of mourning, according to his office.

Polish ambassador Andrzej Ananiczolish and Dutch ambassador Marcel de Vink were also injured in the crash, the army said. The Dutch Ministry of Foreign Affairs confirmed Vink's injury.

Story continues

It was Pakistan's worst air crash since 2012 when a Boeing 737 passenger plane went down in Islamabad, killing 130 people.

In 1988, a plane crash killed Pakistan's then military-ruler General Zia-ul-Haq as well as the US ambassador at the time, Arnold Raphel.

- 'Explosion after landing' -

A local police official on duty near the site told AFP: "I was watching the helicopters arriving, they were coming since the morning, it was their third or fourth trip.

"One helicopter suddenly (started) whirling... and went down with a bang, then there were flames."

An emergency medic who was deployed nearby ahead of the inauguration ceremony said the helicopter only exploded and caught fire after landing.

"The pilot was gesturing at us to come and help him. We rushed there, broke the windows, and started dragging people out.

"After some minutes, there was an explosion, injuring some of the medics too."

Two other eye-witnesses interviewed by AFP also said they did not see any missile hit the helicopter.

"There was no act of terrorism and the helicopter went down due to a technical fault," foreign secretary Aizaz Ahmad Chaudhry told a press conference.

"The Taliban's claim is bogus as there were full security arrangements in place. It was just a technical failure," he added.

Chaudhry said helicopter's black box had also been found and "we will find out what kind of accident it was."

He said there were 19 people on board the chopper, of whom 12 were rescued.

"The Polish ambassador suffered spinal injuries while the Dutch envoy sustained burns to the leg and face," he said. The Indonesian ambassador suffered 75 percent burns and is in a critical condition, he added, while the Malaysian ambassador suffered injuries to his shoulder and face.

Three government ministers will accompany the bodies of envoys and spouses who lost their lives in the crash to their respective countries, the prime minister's office said in a statement.

Abdul Qadir Baloch will go to Norway while Ahsan Iqbal will travel to Malaysia and Indonesia and Khurram Dastagir Khan to the Philippines.

"The ministers would take the dead bodies on special flights as a gesture of respect and to show the importance Pakistan attaches with its relations to these countries," the statement said.

According to a passenger list obtained by AFP, the ambassadors of Indonesia, Lebanon, Malaysia, the Netherlands, Romania, Norway, South Africa, the Philippines and Poland were scheduled to fly on the ill-fated helicopter.

"It was a diplomatic trip with members of 37 countries in total," said a passenger in one of the helicopters, who requested anonymity.

The passenger added that the air convoy was supposed to have included four helicopters but the number was later reduced to three.

The Russian-built Mi-17, used by air forces across the world, has had a patchy safety record in recent years.

Known for its spectacular mountain ranges, Gilgit-Baltistan is a strategically important autonomous region that borders China, Afghanistan and Indian-held Kashmir.