They were travelling to school in a remote mountainous area in Battagram, about 125 miles north of the country’s capital Islamabad, when the incident occurred.
One of the two wires along which the chairlift runs snapped around 7am. The first children were rescued after hours trapped hanging precariously above the ravine.
On Tuesday evening Pakistan’s caretaker Prime Minister Anwaar-ul-Haq Kakar wrote on X, formerly 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.”
Television footage showed one child being lifted off the cable car by a helicopter in a harness and then carried to the ground. A second was pulled to safety using a zip line.
Pakistan’s army called off the helicopter rescue operations more than 12 hours after the cable car became stuck as night fell on Tuesday. But ground rescue operations continued working.
Flood lights were installed and a security source said that cable crossing experts had been sent by the military to the area and rescued the children one by one by transferring them on to a small platform along the cable.
A video shared by a rescue agency official showed more than a dozen rescuers and locals lined up near the edge of the dark ravine, pulling on a cable until a boy attached to it by a harness reached the hillside safely to cries of “God is great”.
Residents said community members from surrounding areas who had experience rescuing people also helped.
“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,” said resident Abdul Nasir Khan.
Local residents watched the scene unfold from a mountainside, and relatives of the trapped passengers prayed anxiously.
The rescue transfixed Pakistanis across the country who crowded around televisions in offices, shops, restaurants and hospitals to watch the mission.
According to Pakistani TV stations, some of those trapped were in contact with their families by mobile phone.
The children are believed to be aged between 10 and 15 years old.
People watch as an army soldier descends from a helicopter during a rescue mission
/ AFP via Getty Images
People who live in the northern mountainous regions of Pakistan often use chairlifts for transport from one village to another.
The journey to the school would take two hours by road, but takes just four minutes by cable car, according to the BBC.
The vehicle is understood to have made four previous trips on Tuesday morning, before the cable snapped on its fifth journey.
Gulfaraz, a 20-year-old man among those trapped in the lift, told Pakistani television channel Geo News by phone that one child, who suffers from a heart condition, had been unconscious for three hours.
“We don’t even have drinking water in the chairlift,” he told the news station.
“The first cable broke down after the chairlift travelled a mile.”
Pakistan’s National Disaster Management Authority said in a statement: “A cable broke in a chairlift service, following which people have been trapped 900 feet (274 metres) above the ground.”
UMEED SAHAR via REUTERS
It said an army helicopter had been moved to the area for a rescue operation after attempts at fixing the fault had been unsuccessful.
Shariq Riaz Khattak, a rescue official at the site, told news agency Reuters the rescue mission was complicated by strong winds in the area and the fact the helicopter’s rotor blades risked snapping the remaining cable.
“One child has fainted due to heat and fear,” Mr Khattak said.