A train in North Texas derailed Sunday morning after plowing through an 18-wheeler that had become stuck on the tracks, authorities said.

The derailment happened just before 10 a.m. near Aledo, about 20 miles west of Fort Worth, when a Union Pacific train traveling to Fort Worth struck a semitruck at a crossing along FM 5 at Annetta Centerpoint Road, the Parker County Sheriff's Office said.

Two train engines and 17 train cars derailed, FOX4 Dallas-Fort Worth reported, citing the Texas Department of Public Safety. The train conductor was treated at a hospital for minor injuries.

Bystanders captured video of the train smashing through the truck.

US CUSTOMS TO SUSPEND RAILWAY OPERATIONS AT INTERNATIONAL CROSSINGS INTO TEXAS STARTING MONDAY

train striking 18-wheeler

A Union Pacific train struck an 18-wheeler that had become stuck on the tracks Sunday near Aledo, Texas. (Samuel Ingram via Storyful)

"Oh my god," Samuel Ingram can be heard saying from inside his car as he watched the train derail. "Look at the train, it is flipping upside down."

broken semi-truck trailer and derailed train

The sheriff’s office said that some oil and diesel fuel spilled, but officials determined there was no danger to the public. (Parker County Emergency Services District 1)

SUBWAY TRAINS COLLIDE IN BEIJING, LEAVING 515 PASSENGERS HOSPITALIZED

The sheriff’s office said that some oil and diesel fuel spilled, but the fire department and hazmat crews were at the scene. No other chemicals were spilled and there was no danger to the public.

broken semi-truck trailer

The 18-wheeler had become stuck at a rail crossing along FM 5 at Annetta Centerpoint Road in Parker County. (Parker County Emergency Services District 1)

CLICK TO GET THE FOX NEWS APP

FM 5 was temporarily closed as officials worked at the scene.