Pakistan breathed a sigh of relief last night after all the children who were trapped in a broken down cable car suspended 1,200ft in the air were brought to safety, marking the end of an intense 16-hour rescue operation.

The gondola had been carrying six youngsters and two adults, thought to be teachers, to their school in the remote mountainous region of Battagram, 120 miles north of Islamabad, when one of the cables snapped at around 7am yesterday.

It sparked a frantic helicopter mission lasting much of the day, seeing the students, aged between 11 and 15, and their companions pulled out one by one.

As darkness fell, four of the six children had been rescued but there were fears the remaining two would be left stranded overnight, as high winds and the lack of light led to the air rescue being called off.

But the determined team continued to work throughout the night, using a makeshift chairlift and zip line experts to retrieve the final pupils.

Heartwarming footage has shown two of the youngsters being zip lined with experts onto the steep side of the mountain, where they were met with cheers and applause from a huge crowd of people.

Young boys who had been caught up in the terrifying ordeal were later seen receiving oxygen and first aid from medical teams, before being comforted by other locals.

Youngsters who had been stranded in the broken cable car are surrounded by villagers following their rescue

A youngster is helped by villagers after being rescued from a dangling cable car

This is the moment the final children who had been stranded in a broken down cable car were zip lined to safety

The youngsters, thought to be the final children rescued from the cart, were met with cheers and applause from an anxiously-waiting crowd

All six children and the two adults on board the broken cable car have now been rescued

The cable car snapped leaving eight people dangling 1,200ft above the river canyon in Battagram, around 120 miles north of Islamabad

Residents from the area around 120 miles north of Islamabad waved at the two boys, while others filmed them being pulled in on the rope and cried 'God is great'.

The rescued children were quickly handed over to the safety of their families, most of whom burst into tears, according to Nazi Ahmed, a senior police officer who helped coordinate the rescue mission. 'Everyone was praying for this moment,' he added.

The eyes of the world had been watching the fraught situation unfold. Local police officer Sonia Shamroz told the Telegraph that air pressure created by the rescue helicopter had threatened to unbalance the chairlift.

This triggered panic for those inside the rickety cable car - with one child fainting - making the mission more complex.

Ahead of the successful rescue, local government official Tanveer-ul-Rehman called the effor a 'delicate operation that demands meticulous accuracy'.

He added: 'The helicopter can not approach the chairlift closely, as its downwash (air pressure) might snap the sole chain supporting it.'

Others standing anxiously near the ravine were praying for the children's safety, hearing their screams every time the helicopter approached and made it rock back and forth.

'Our situation is precarious, for god's sake do something,' Gulfaraz, a 20-year-old on the cable car, told local television channel Geo News over the phone, appealing to authorities to rescue them as soon as possible. 'People in our area are standing here crying.'

This is the incredible moment military commandoes rescue school children stranded in a broken-down cable car dangling 1,200ft above a deep valley in Pakistan

'Every time the helicopter lowered the rescuer closer to the chairlift, the wind from the helicopter would shake and disbalance the chairlift making the children scream in fear,' Ghulamullah, chairman of the Allai valley area, told Geo News.

Food and water were supplied to the car earlier in the day, said Bilal Faizi, a spokesperson for the state-run emergency service.

Headmaster Ali Asghar Khan told AFP by phone that the children were teenage boys and students at his government high school Battangi Pashto.

'The school is located in a mountainous area and there are no safe crossings, so it's common to use the chairlift,' Khan said.

'The parents are gathered at the site of the chairlift. What can they do? They are waiting for the rescue officials to get their children out. We are all worried.'

Abid Ur Rehman, a teacher from another school in the area, said around 500 people had gathered to watch the rescue mission.

'Parents and women are crying for the safety of their children,' he told AFP.

Earlier footage had shown the cable car perilously dangling over the deep valley, while another video showed the tense moment a rescuer suspended from a helicopter was lowered to the car dangling by a single cable. Strapped in the harness, the child was carried to the ground.

Food and water were supplied to the car earlier in the day, said Bilal Faizi, a spokesperson for the state-run emergency service.

Local residents said community members from surrounding areas who had experience rescuing people this way had also arrived.

Several military helicopters flew reconnaissance sorties and an airman was lowered by harness to deliver food, water and medicine

. Caretaker Prime Minister Anwaar ul Haq Kakar said on X: 'Relieved to know that Alhamdolillah all the kids have been successfully and safely rescued

The UK's high commissioner to Pakistan Jane Marriott said: 'A huge relief that all those caught up in the cable car incident in Battagram are now safely back on the ground'

'It is a slow and risky operation. One person needs to tie himself with a rope and he will go in a small chairlift and rescue them one by one,' Abdul Nasir Khan, a nearby resident, said before the rescue was completed.

Talaat Masood, a retired Pakistan army general told the BBC that using the cable car to save the trapped children would be 'a lesser challenge' than using the helicopter at night.

The rescue mission had been complicated due to gusty winds in the area and the fact the helicopters' rotor blades risk further destabilising the lift, he said.

An army soldier slings down from a helicopter during a rescue mission to recover the students stuck in the cable car

Following the incident, Caretaker Prime Minister Anwaar-ul-Haq Kakar issued a directive for all cable cars in mountainous areas to be inspected and for those that are not 'safety compliant' to be immediately closed

The cable car appeared to be tipping on its side after the wire of the vehicle snapped

The gondola broke down at around 7:00 am local time, with residents using mosque loudspeakers to alert neighbourhood officials across the Allai valley.

Syed Hammad Haider, a senior Khyber Pakhtunkhwa provincial official, said the gondola was hanging 1,200 feet above the ground

Cable cars that carry passengers and sometimes cars are common across the northern areas of Khyber Pakhtunkhwa province and Gilgit-Baltistan, and are vital in connecting villages and towns in areas where roads cannot be built.

Caretaker Prime Minister Anwaar-ul-Haq Kakar has since issued a directive for all cable cars in mountainous areas to be inspected and for those that are not 'safety compliant' to be immediately closed.

The rescue effort transfixed the country, with Pakistanis crowded around television sets, as local media showed footage of an emergency worker dangling from a helicopter cable close to the small cabin, with those onboard cramped together.

Following the success, Prime Minister Anwaar ul Haq Kakar said on X, formally known as Twitter: 'Relieved to know that Alhamdolillah all the kids have been successfully and safely rescued.

'Great team work by the military, rescue departments, district administration as well as the local people.'

The UK's high commissioner to Pakistan Jane Marriott said: 'A huge relief that all those caught up in the cable car incident in Battagram are now safely back on the ground.

'Thank you to all those who worked tirelessly to make this happen.'

According to Pakistani TV stations, some of those who had been trapped were in contact with their families by mobile phone.

Muzaffar Khan, a district administration official in Battagram, said there were seven students and one teacher aboard, updating from the earlier reported six students and two teachers.

Cable cars that carry passengers and sometimes cars are common across the northern areas of Khyber Pakhtunkhwa province and Gilgit-Baltistan, and are vital in connecting villages and towns in areas where roads cannot be built.

In 2017, 10 people were killed when a chairlift cable broke, sending passengers plunging into a ravine in a mountain hamlet near capital Islamabad.