A Texas sheriff’s deputy narrowly escaped tragedy after a semi-truck plowed into his patrol vehicle, leaving him dangling off a highway overpass before good Samaritans rushed in to pull him to safety, as reported by The New York Post.

The incident occurred in Lubbock County when deputies Andrew Cavasos, 49, and Jorge Martinez, 36, stopped to assist a motorist with a flat tire, according to the Lubbock Avalanche-Journal.

Trump's Sovereign Wealth Fund: What Could It Mean For Your Money?

While the deputies were on scene, a truck driver slammed into one of the patrol cars, sending it crashing into a concrete barrier.

Dramatic video captured the aftermath, showing Deputy Cavasos pinned against the barrier, his legs trapped as the rest of his body hung over the edge of the bridge. With the squad car totaled, his grip on life came down to seconds.

Several bystanders at a nearby gas station immediately sprang into action. They raced to the scene, tying a rope around Cavasos and holding him by his arms to prevent him from falling.

This Could Be the Most Important Video Gun Owners Watch All Year

Do you support the name change from Department of Defense to Department of War?

By completing the poll, you agree to receive emails from RVM News, occasional offers from our partners and that you've read and agree to our privacy policy and legal statement.

Others carried ladders to the bridge, with one man climbing up to help hold the deputy steady from below.

“We got a ladder and just helped out as best as we can,” rescuer Kohl Stephenson told Fox 4 News.

Emergency crews eventually freed the deputy after moving the crushed patrol car, pulling him back onto the bridge. Both Cavasos and Martinez were hospitalized, along with a civilian who had also been injured in the crash. All three have since been released from the hospital.

“I appreciate everyone that helped, it could have gone a lot different without you there,” Deputy Cavasos said after his release.

Lubbock County Sheriff Kelly Rowe credited the bystanders with saving lives. “God is great. He certainly was watching out for two young men yesterday. Absolutely no doubt in my mind,” Rowe said.

“To each and every one of them that found a ladder, held the guy up, moved debris to help get vehicles drug out of the way so we can get these guys the help they needed with EMS and Fire — again, like I said, I can’t say enough in terms of thank you’s to each and every one of them,” Rowe continued.

“Hopefully, I’ll get a chance to tell some of them personally. Truly.”

Authorities have not filed charges against the truck driver as the investigation continues.