California firefighters on Thursday rescued a bear that wandered into Six Flags Magic Mountain and got stuck between two trailers, authorities said.

Firefighters worked for hours to free the bear from between the two Conex trailers on the amusement park’s back lot in Valencia, the Los Angeles County Fire Department said.

‘LAW-ABIDING’ BEAR CROSSES STREET LIKE A PRO IN NORTH CAROLINA, VIDEO SHOWS

The fire crew was assisted by Heavy Rescue 103, USAR 136, California Fish and Game, and the Los Angeles County Department of Animal Care and Control. 

Los Angeles fire rescue bear six flags

Fire crews responded to Six Flags Magic Mountain in Valencia, Calif., on Thursday after a curios bear wandered into the theme park and got trapped between two trailers. (Los Angeles County Fire Department )

After hours of working, USAR 136 was able to use its equipment to move one trailer to allow rescuers to reach the bear.

Los Angeles fire rescue bear six flags

The bear was sedated before rescuers attempted to bring the bear to safety. (Los Angeles County Fire Department )

Officials sedated the bear before attempting to pull it to safety.

CLICK HERE TO GET THE FOX NEWS APP

The bear was then prepared for transport so Fish and Game personnel could relocate it safely.

It was unclear where the bear was moved to.