A shirtless, allegedly intoxicated man is accused of trying to take an Amtrak train for a joyride in northern California early Monday morning, a harrowing incident that left crewmen fearing for their safety and resulted in the 26-year-old suspect going from behind the wheel to behind bars.

Thomas Baldini, a 26-year-old from McCloud, is now facing charges including being intoxicated in public and interfering and hindering the safe and efficient operation of a train following the bizarre incident near Cantara Loop.

“We are grateful the prompt response…helped to mitigate what could have been a very dangerous outcome on a moving train, which obviously involved actions that potentially jeopardized the safety of passengers, crew and others in the community,” Siskiyou County Sheriff Jon Lopey said.

Police say Baldini allegedly jumped on-board the back-up engine of the train at about 1 a.m. Authorities said he almost immediately started to exhibit hostility.

Baldini “allegedly attempted to manipulate train-related control devices and activated the train whistle on numerous occasions” while also attempting to place the train in an “emergency stop mode.” The incident left crewmembers fearful for their safety until police arrived, officials said.

An Amtrak spokesperson told Fox News that the train was stopped during the time of the incident and Baldini had "no access to the locomotive powering the train."

Baldini was sent to a local jail after being evaluated at a hospital.