Story highlights All passengers on the ride have been rescued

Part of the Ninja ride at Six Flags Magic Mountain was hanging off the track

Six Flags: A tree branch fell on the track, obstructing the train

Last year, a woman in Texas died after she was thrown from her roller coaster seat

Americans love roller coasters -- until something goes wrong.

Attention turned to amusement park safety after a tree branch that fell on the tracks derailed a roller coaster car at a Six Flags amusement park Monday evening, leaving it dangling precariously and its occupants stranded for hours.

Four people were injured on the Ninja ride at Six Flags Magic Mountain, the Los Angeles County Fire Department said. Two of the four were taken to a hospital as a precautionary measure.

It was an amusement park enthusiast's nightmare. "It was just a lot of leaf noise and then cracking noises and crashing noises and a lot of screaming," Brandy Chambers, who witnessed the incident from her vantage point on another ride, told CNN affiliate KTLA

JUST WATCHED Six Flags coaster derails in California Replay More Videos ... MUST WATCH Six Flags coaster derails in California 01:53

Photos: World's most popular theme parks Photos: World's most popular theme parks 25. Yokohama Hakkeijima Sea Paradise, Japan – 25. Yokohama Hakkeijima Sea Paradise in Japan features amusement park rides, an aquarium and over 500 varieties of fish. Hide Caption 1 of 25 Photos: World's most popular theme parks 24. Efteling, Netherlands – 24. Efteling theme park in the Netherlands is one of the oldest theme parks in the world. Hide Caption 2 of 25 Photos: World's most popular theme parks 23. Tivoli Gardens, Denmark – 23.Tivoli Gardens in Denmark features all sorts of amusements and entertainments. Hide Caption 3 of 25 Photos: World's most popular theme parks 22. SeaWorld California – 22. While SeaWorld California has come under fire recently, with questions being raised about the care of its whales, visitors keep coming to see Shamu and other marine animals perform. Hide Caption 4 of 25 Photos: World's most popular theme parks 21. Walt Disney Studios, France – 21. Walt Disney Studios Park at Disneyland Paris is just one part of Disney's French empire. Hide Caption 5 of 25 Photos: World's most popular theme parks 20. Europa-Park, Germany – 20. Europa-Park in Germany features a restaurant with a one-star Michelin rating. Hide Caption 6 of 25 Photos: World's most popular theme parks 19. SeaWorld Florida – 19. SeaWorld Florida also features the famous whales in its shows. Hide Caption 7 of 25 Photos: World's most popular theme parks 18. Nagashima Spa Land, Japan – 18. Check out the Steel Dragon roller coaster at Nagashima Spa Land in Japan. Hide Caption 8 of 25 Photos: World's most popular theme parks 17. Universal Studios Hollywood, California – 17. Universal Studios Hollywood offers behind-the-scenes access to Universal Studios movies (the VIP tour is shown here). Hide Caption 9 of 25 Photos: World's most popular theme parks 16. Universal Studios, Florida – 16. Universal Studios at Universal Orlando in Florida is abuzz with additions to the Wizarding World of Harry Potter, shown here in 2010. Hide Caption 10 of 25 Photos: World's most popular theme parks 15. Everland, South Korea – 15. The Everland amusement and animal park in Yongin, south of Seoul, is South Korea's largest amusement park. Hide Caption 11 of 25 Photos: World's most popular theme parks 14. Lotte World, South Korea – 14. Lotte World in South Korea includes a theme park, shopping mall, hotel, sports facilities and a movie theater. Hide Caption 12 of 25 Photos: World's most popular theme parks 13. Hong Kong Disneyland – 13. Toy Story Land is one of the star attractions at Hong Kong Disneyland. Hide Caption 13 of 25 Photos: World's most popular theme parks 12. Ocean Park, Hong Kong – 12. Ocean Park in Hong Kong has been criticized for how it treats its marine life, much like SeaWorld, but visitors keep coming to the park. Hide Caption 14 of 25 Photos: World's most popular theme parks 11. Islands of Adventure, Florida – 11. Islands of Adventure at Universal Orlando features the Jurassic Park river adventure, where visitors will spot friendly and not-so-friendly dinosaurs. Hide Caption 15 of 25 Photos: World's most popular theme parks 10. Disney's California Adventure – 10. Disney's California Adventure Park features Mickey's Fun Wheel and the California Screamin' roller coaster. Hide Caption 16 of 25 Photos: World's most popular theme parks 9. Universal Studios Japan – 9. Universal Studios Japan in Osaka features Universal Wonderland, an amusement zone within the park. Hide Caption 17 of 25 Photos: World's most popular theme parks 8. Disney's Hollywood Studios, Florida – 8. Disney's Hollywood Studios theme park at Florida's Walt Disney World Resort welcomed daytime TV talk show host Wendy Williams and her son Kevin, shown here on a ride on Toy Story Midway Mania! Hide Caption 18 of 25 Photos: World's most popular theme parks 7. Disney's Animal Kingdom, Florida – 7. Disney's Animal Kingdom at Walt Disney World in Florida offers hotel views of animals wandering by. Hide Caption 19 of 25 Photos: World's most popular theme parks 6. Disneyland Park, France – 6. Mickey Mouse poses in front of the Sleeping Beauty Castle at the Disneyland park outside of Paris. Hide Caption 20 of 25 Photos: World's most popular theme parks 5. Disney's Epcot, Florida – 5. Disney's Epcot at Walt Disney World in Florida features the futuristic Spaceship Earth geosphere and monorail, shown here. Hide Caption 21 of 25 Photos: World's most popular theme parks 4. Tokyo DisneySea, Japan – 4. Tokyo DisneySea offers steamer boat rides through all the ports of the park. Hide Caption 22 of 25 Photos: World's most popular theme parks 3. Disneyland, California – 3. There's nothing like visiting the original Disneyland, featuring Mickey and Minnie Mouse in front of Sleeping Beauty Castle in Anaheim, California. Hide Caption 23 of 25 Photos: World's most popular theme parks 2. Tokyo Disneyland, Japan – 2. Tokyo Disneyland celebrated its 30th anniversary in 2013. Hide Caption 24 of 25 Photos: World's most popular theme parks 1. Magic Kingdom, Florida – 1. It takes many hands to keep the Magic Kingdom in Florida on top as the No. 1 amusement park in the world. Here a custodian polishes the Walt Disney and Mickey Mouse statue at the Orlando park. Hide Caption 25 of 25

But worldwide, such incidents are very rare, and attendance at amusement parks has been increasing, experts say.

According to the International Association of Amusement Parks and Attractions, there are 4.3 injuries per million attendees at U.S. fixed-site amusement parks, citing 2011 statistics.

In 2011, the chance of being "seriously injured" at fixed-site amusement parks in the U.S. was 1 in 24 million, the IAAPA reported.

Still, it's hard to ignore images of a roller coaster car filled with people, drooping from the track.

The front part of the roller coaster detached from the track and dangled at about a 45-degree angle, pointing to the ground.

The car was about 20 feet in the air, Los Angeles Fire Department supervisor Ed Pittmann told KTLA.

Rescue workers climbed atop the track and used a thick rope to tie the front of the car to the track above.

By late Monday night, all 22 passengers had been rescued.

Twitter was abuzz Tuesday with people claiming they would never ride a roller coaster again.

Six Flags Magic Mountain is the 18th most popular amusement park in North America, with more than 2.9 million visitors in 2013, according to the Themed Entertainment Association and AECOM global attractions attendance report. The index lists the 25 most visited amusement parks and theme parks worldwide, based on attendance figures compiled by AECOM..

The derailment happened after a tree branch fell on the track, obstructing the train, Six Flags Magic Mountain spokeswoman Sue Carpenter said.

Six Flags describes the Ninja ride as a " stealth assassin " on its website.

"The black belt of roller coasters whips you into submission," the site says.

Passengers ride the swinging coaster suspended from the track instead of riding on top of the track.

The derailment is the latest in a series of high-profile roller coaster accidents in recent years.

Last July, Six Flags Over Texas in Arlington shut down its Texas Giant roller coaster after a woman was thrown from her seat and plunged to her death.

Between 1990 and 2010, more than 92,000 children were injured in amusement ride-related incidents, according to a study by the Center for Injury Research and Policy at Nationwide Children's Hospital in Ohio. That's an average of more than 4,000 injuries per year.

The IAAPA had lower estimates for amusement park injuries -- falling from about 2,500 in 2001 to 1,200 in 2011.

Safety is on the mind of riders following Monday's derailment, and the organization provides a number of common-sense safety tips.

Among those: Obey age and height restrictions, keep arms and legs inside the ride, and report any unsafe behavior or condition to an attendant.