A freight train flew off the rails in the center of a small North Texas town Wednesday morning, smashing into a resident's backyard and just narrowly missing his house, reports said.

Seven of the Union Pacific cargo train's 13 empty rail cars overturned in Aubrey, about 50 miles north of Dallas, Fox 4 Dallas reported. The locomotive remained upright.

DENMARK TRAIN CRASH VICTIMS IDENTIFIED, ALL 8 ARE DANES

The train derailed into Rick Huckabee's yard, where it knocked down a tree that fell and damaged a portion of his roof, Fox 4 reported.

“I just called my wife and told her we had a train in the backyard,” he told the station. “We’re fortunate. It didn’t really tear up anything we can’t fix, except for that tree."

“I just called my wife and told her we had a train in the backyard. We’re fortunate. It didn’t really tear up anything we can’t fix, except for that tree."

— Rick Huckabee, resident of Aubrey, Texas

City Administrator Mark Kaiser said there were no injuries or damage to any structures, but an empty freight car punched through a resident’s backyard fence by about 4 feet.

CLICK HERE TO GET THE FOX NEWS APP

Union Pacific officials don’t know yet what caused the derailment, which closed the rail line between Fort Worth and McAlester, Oklahoma, until Thursday.

The Associated Press contributed to this report.