It happened on Tuesday around 5 p.m. on SH 94 just west of Groveton.
According to Trinity County Sheriff Woody Wallace, attorney Colton Hay saw a driver speeding and passing in a no passing zone as rain was pouring down. He said Hay saw the car hydroplane and flip into a ditch.
"The car came to a stop upside down in about a foot of water with oil and other fluids leaking from the car," wrote Wallace on Facebook.
READ ALSO: Houston man rescues 2-year-old found walking alone at night near I-45 feeder
Hay stopped to help when he noticed there was a baby in the car. Hay, who began serving as a Trinity County attorney in January, recently became a dad himself.
Wallace said Hay used a sledge hammer that he had in his truck to smash in the car window to get the baby out.
"The child was in a car seat, but the car seat was not strapped into the vehicle which created a very unsafe situation for the child," said Wallace.
Hay along with other good Samaritans were able to safely rescue the child. Wallace said the child was sent to the hospital with non-life threatening injuries.
Meanwhile, the driver of the car was arrested by a Texas DPS trooper. Wallace said the driver was charged for driving with an invalid license. Other charges are pending, he said.
The incident remains under investigation.
READ ALSO: UPS driver named Angel saves boy trapped under 90-pound box