A United Airlines flight from San Diego to Chicago made an emergency landing in New Mexico on Monday morning due to a “mechanical issue” that apparently caused “sparks” to spew from one of the plane’s engines.

Passenger Thomas Chorny had trouble sleeping during United flight 366, which departed the Golden State on Sunday night. Upon looking out the window, Chorny said he saw what appeared to be "flames streaming from the engine” and started recording, USA Today reports.

About 10 minutes later, flight crew officials announced that the aircraft would be landing early, Chorny told NBC News.

QANTAS AIRWAYS PASSENGERS ESCAPE SMOKE-FILLED PLANE AS 'CAPTAIN SCREAMED' TO EVACUATE

“I had to show [United employees] the video when we landed because they didn’t know there were flames. Talk to your pilots people!!!” the traveler tweeted.

Chorny, who works as the director of track and field and cross country at Miami University in Ohio, also shared a 5-second video of a flashing purple light in the darkness, which has since been viewed nearly 4,000 times on Twitter.

“Strange to sit there & think ‘What if this is it?’ To just sit there & accept the potential fate that seems to be a possibility & not tell the sleeping people all around you,” he wrote. “No need to panic the others. I’m a pretty calm person but took me a while to stop the shakes and trembles.”

United Airlines flight

A United Airlines spokesperson told Fox News that flight 366 diverted safely, and new arrangements were made for passengers to get to Chicago. (iStock)

FOLLOW US ON FACEBOOK FOR MORE FOX LIFESTYLE NEWS

When reached for comment, a spokesperson for the carrier told Fox News that flight 366 diverted safely, and new arrangements were made for passengers to get to Chicago.

“United flight 366 from San Diego to Chicago diverted to Albuquerque following a mechanical issue with one of the engines. The flight landed safely, and customers deplaned normally at the gate,” the spokesperson told Fox News on Monday afternoon. “Our maintenance team in Albuquerque will inspect the aircraft and we’ve arranged for a different plane to get our customers to their destination which has departed.”

CLICK HERE TO GET THE FOX NEWS APP

The airline representative further clarified that “sparks” appeared to emit from the engine, though a full inspection will be necessary to determine exactly what happened.