Authorities say 24 people stranded on a roller coaster have been rescued from near the top of the ride at Six Flags America in Maryland, according to Reuters.

The passengers were trapped about 75 feet in the air atop the Joker's Jinx roller coaster at the Six Flags America amusement park in Upper Marlboro, outside Washington, fire officials said, Reuters reported.

The ride stopped working at 2:30 p.m. and the rescue took about four hours, according to Prince George's County Fire Chief Marc Bashoor, according to Reuters.

Prince George's County Fire officials say it took about five hours Sunday to rescue 17 adults and seven children from The Joker's Jinx roller coaster, Reuters reported.

Assistant Fire Chief Paul Gomez says the riders were sitting upright, according to the AP. A few of the riders had cramps, back pain and dehydration, but there were no major injuries and the passengers were checked by medical personnel before being released..

A Six Flags America spokesman said in a statement that it is not yet clear what caused the ride to stop but that it has a computerized safety system that "performed as it is designed to," according to Reuters.

Six Flags' website says the ride goes 60 miles per hour and upside down four times, Reuters reported.

Crews used a tower bucket to reach stranded passengers, according to Reuters. They were unstrapped one by one, loaded into the bucket and then it was lowered to the ground, he said.

Six Flags Entertainment Corp said in a statement the ride would remain closed during an investigation into what caused the malfunction, Reuters reported.

"While we are not yet sure what caused the stoppage, the ride performed as it is designed to," Six Flags said in a statement, according to Reuters.