A Texas deputy who was trying to be a Good Samaritan wound up a victim after a train hit his car, according to officials.

WISCONSIN FIREFIGHTER DIES AFTER BEING SHOT RESPONDING TO MEDICAL CALL, OFFICIALS SAY

The Midland County deputy had tried to cross the railroad tracks responding to a call of a baby in distress, but was hit by a train on a track, Fox 7 Austin reported.

Video showed how the vehicle was flipped from the force of impact.

The deputy was rushed to a local hospital with minor injuries, including bruising throughout his body, officials said.

CLICK HERE TO GET THE FOX NEWS APP

The baby was found and taken to the hospital, as well.

Midland County is about 130 miles south of Lubbock.

Click for more from Fox 7 Austin.