Battling anxiety and nausea, they huddled together in the ruptured cable car, gripped by fear as they dangled precariously hundreds of feet in the air.
With little to drink and some of them drifting in and out of consciousness, the six children and two adults endured a 14-hour ordeal stranded above the lush forests of Pakistan's mountainous northern Khyber Pakhtunkhwa province, their lives hanging in the balance.
But their cries for help were answered and late Tuesday, authorities revealed how they painstakingly saved the passengers -- one by helicopter and the others via zipline -- in a remarkable rescue operation complicated by the weather.
"The extremely difficult rescue mission was made more difficult by the strong winds in the area and the dangers involved in such operations, including the helicopter's rotor blades destabilizing the lift," Pakistan's armed forces said in a statement.
The cable car, which was traveling between the villages of Batangi and Jhangri in Battagram district -- about four hours from the nearest road -- is used to ferry children to school, cutting down a nearly four-hour journey to a matter of minutes.
But what was meant to be a quick gondola trip turned into a nerve-wrecking life or death scenario, after one of the car's cables snapped, leaving the group trapped some 900 feet (about 275 meters) above a valley.
With the car suspended from what appeared to be just a single cable, military personnel embarked on a frantic mission to rescue those on board, pulling one child out by helicopter and bringing the others to safety via a zip line as night fell.
Footage released by the rescue services captured the dramatic moment when one child appeared to jump from the cable car, while desperately clinging to the end of a rope dangling from a helicopter, before being flown to safety.
In another video, workers can be seen pulling the two adults to land on a zip line after night fall made air rescue difficult.
As they waited to be rescued, two of the students in the cable car were slipping in and out of consciousness, one of the passengers told Pakistani outlet Geo News. The passenger, named only as Gulfaraz, had urged state authorities to take action. He said the students didn't even have drinking water.
Rescue personnel gave the passengers nausea medication following reports of children vomiting, and those trapped were given heart-related medication, according to Tanveer Ur Rehman, deputy commissioner of Battagram district.
News of the successful rescue reverberated across Pakistan.
"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," caretaker Prime Minister Anwaar ul Haq Kakar wrote on X, formerly known as Twitter.
Cable cars are a regular mode of transport for residents of Khyber Pakhtunkhwa, where travel between villages can take hours owing to the thick forests and challenging terrain.
Battagram district, where the cable car is located, is deeply impoverished and lacks infrastructure and development. Families rely on the locally-built gondolas, some of which are made with scraps of metal and discarded vans, to travel to school and even to the hospital.
However, these cable cars can lack proper maintenance and have been involved in disasters in the past. Last December, 12 children were rescued from another cable car in eastern Khyber Pakhtunkhwa.
That incident prompted Pakistan's caretaker prime minister to order all "dilapidated and non-compliant chairlifts" to close immediately, according to a statement from his office at the time.