Military helicopters and zipline experts on Tuesday rescued eight people, including six school boys, trapped for hours in a stricken cable car high above a remote Pakistan valley.
The daring rescue began with a helicopter plucking two children to safety after almost 12 hours in the air as daylight faded, but the chopper was forced back to base in the dark.
Then rescuers used the cable keeping the gondola from plunging into the valley as a zipline to rescue the rest of those stranded late into Tuesday night.
"Once everyone had been rescued, the families started crying with joy and hugging each other," emergency official Waqar Ahmad told AFP over the phone.
"People had been constantly praying because there was a fear that the rope might break. People kept praying until the last person was rescued."
The military confirmed the operation had successfully concluded.
Bilal Faizi, an official with Pakistan's emergency service, said the two adults were the last to be brought to safety.
A video of the first rescue showed a teenager in a harness hanging at the bottom of a swinging rope under a helicopter as crowds cheered with relief.
Rescuers set up a temporary camp on a mountaintop and were providing first aid, Faizi said.
- 'Great team work' -
The six children had been on their way to school when the chairlift broke down at around 7:00 am (0200 GMT) midway through its journey, hanging above the lush green Allai valley.
Residents used mosque loudspeakers to alert neighbourhood officials of the emergency and hundreds of people gathered on both sides of the ravine -- hours away from any sizeable town -- to watch the drama unfold.
Several military helicopters had earlier in the day flown sorties and an airman was lowered by a harness to deliver food, water and medicine, Rehman, the official, told AFP.
"Great team work by the military, rescue departments, district administration as well as the local people," caretaker Prime Minister Anwaar-ul-Haq Kakar posted on X.
He earlier issued a directive for all chairlifts in mountainous areas to be inspected and for those that are not safe to be immediately closed.
- 'What can they do?' -
Earlier in the day, as the rescue operation unfolded, 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.
Syed Hammad Haider, a senior Khyber Pakhtunkhwa provincial official, said the gondola was hanging about 1,000 to 1,200 feet above the ground.
Cable cars that carry passengers -- and sometimes even 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 the capital Islamabad.