Eight people trapped on a dangling cable car in Pakistan have been rescued, the country’s interior ministry said Tuesday.

Six children and two adults were trapped precariously more than 900 feet in the air for more than 15 hours, the BBC reported.

Bilal Faizi, an official with the Pakistan emergency service, said: “The rescue operation has been completed. The two adults were the last to be rescued.”

Pakistani Caretaker Prime Minister Anwaar ul-Haq Kakar said he was “closely monitoring” the rescue efforts.

“Thanks to the efforts of our army personnel, Air Force, rescue organizations, district administration, and others,” he posted on social media. “Relieved to know that [praise be to God] all the kids have been successfully and safely rescued.”

CLICK HERE TO GET THE DALLAS EXPRESS APP

The ordeal began when two of the aerial gondola’s three cables snapped as the eight passengers traveled to school in the province of Khyber Pakhtunkhwa, leaving them stuck, officials said. More than 400 people use the cable car line to commute daily, according to The New York Times.

One child appeared to jump from the gondola while holding onto the end of a rope dangling from a rescue helicopter before being flown to safety, reports said.

Tanveer Ur Rehman, deputy commissioner of the Battagram district, said rescue personnel delivered nausea medication to the cable car after reports of children vomiting. Some trapped were also given heart-related medication, CNN reported.

The incident played out in the village of Pashto in the remote Allai Valley region in northwestern Pakistan.

“They are in front of us, but we are helpless — observing them and unable to provide any help,” Mufti Hasan Zaib, whose relative was trapped in the cable car, said in a phone interview Tuesday afternoon.

The Allai region was previously struck by tragedy in 2005 in the form of an earthquake that killed more than 80,000, the NYT reported.

“As beautiful as this valley is, it holds many times more hidden sorrows,” said Maulana Qasim Mehmood, a local religious leader. “The villages in Allai are several decades behind the global development standards.”

The caretaker prime minister ordered all “dilapidated and non-compliant chairlifts” to close immediately, according to a statement from his office.