DAYTONA BEACH, Fla. — Two people fell 34 feet to the ground when a roller coaster derailed at the Daytona Beach Boardwalk, leaving the front car dangling precariously from the tracks.

A total of 10 riders were rescued, with six taken to the hospital, according to a tweet from the Daytona Beach Fire Department. The extent of all of their injuries was not immediately known, the fire department said.

The cause of the accident was under investigation, according to Daytona Beach Fire spokeswoman Sasha Staton.

"It looked like it just flipped upside down, like it was part of the ride," said Paige Ailor, who witnessed at the incident at the Mardi Gras Fun Center, an amusement park on the boardwalk.

Firefighters used a tower truck to save stranded passengers, a rescue effort that took roughly an hour.

DB Firefighters working as fast as they can to rescue 2 riders that are in a dangling rollercoaster car pic.twitter.com/v0UrChJdHC — DaytonaBeachFireDept (@DaytonaBeachFD) June 15, 2018

Landyn Metler nearly went on the ride, known as the Sandblaster. But she ended up staying on the boardwalk after failing to convince her 11-year-old brother to join her.

"We are so glad we didn't get on that ride," said Metler. "It was very scary."

The owners of the ride did not immediately return a request for comment from NBC News.

Officials said the roller coaster passed a state inspection only hours before it derailed. It was "found in compliance with state law," Florida Department of Agriculture and Consumer Services spokeswoman Jennifer Meale said in a statement Friday.

But state records show that on May 17, an inspection of the roller coaster found excessive corrosion, damaged passenger cars and cracked bracing.

The state agency is investigating the reason for the derailment, vowing that "anyone who should be held accountable will be held accountable."

Sandblaster was manufactured in 1975, according to an online database.