PESHAWAR, Pakistan (AP) — Army commandos using helicopters and a makeshift chairlift rescued eight people from a broken cable car as it dangled hundreds of meters (feet) above a canyon in Pakistan.

Authorities said the rescues were completed late Tuesday in a remote, mountainous part of the country.

The six children and two adults became trapped when a cable snapped while they were crossing a river canyon.

The children were on their way to school.

The Pakistani prime minister congratulated rescuers for the success.

The dramatic effort transfixed the country for hours as Pakistanis crowded around televisions in offices, shops, restaurants and hospitals.