Updated

A police officer in central Texas was nearly killed Wednesday after she was dragged nearly half a mile by a suspect who sped away during a traffic stop, officials said.

The Williamson County Sheriff’s office said the incident happened around 3 a.m. on the side of a highway in Round Rock, located north of Austin, when the officer approached the vehicle that was sitting through multiple traffic light cycles without moving.

“He almost killed one of my deputies today," Williamson County Sheriff Robert Chody told FOX7.

The suspect, identified as Jonathan Nunnally, 22, drove off while the deputy was standing next to the vehicle with the driver's door open in a dramatic moment captured on dashcam video.

“What you don’t see in the video initially is the deputy is knocking on the window and at that point the driver of the vehicle wakes up and starts to drive off at a very slow speed. The deputy knocks on the window and opens the door and the driver stops,” Chody.

Jonathan Nunnally

Jonathan Nunnally, who drove off and dragged a police officer nearly a half-mile, according to police. (Wiliamson County Sheriff's Office)

The deputy repeatedly asked Nunnally for his driver’s license and insurance, but his response was too jumbled to understand. Chody said the deputy collected a set of keys from Nunnally and placed them on top of the vehicle, but he had another set he used to turn the car back on and floor it away.

TEXAS POLICE OFFICER KILLED, SUSPECT IN CUSTODY AFTER STANDOFF

In the dash cam video, the deputy could be heard calling for backup and yelling, "You have my foot, you have my foot," while holding on as the car speeds off.

"The deputy, while the suspect is driving off is trying to be pushed out, kicked out by the suspect I believe possibly trying to kill her,” Chody told FOX7.

The 22-year-old stopped the car several hundred feet away, where the deputy was able to tase and arrest him. He's since been charged with aggravated assault on a public servant with a public weapon. Marijuana and cough syrup were also found in the vehicle, according to Chody.

Chody praised his deputy's actions, saying that she could have used deadly force but did not.

"WilCo Sheriffs deputies showed great restraint when deadly force could've been used therefore it wont make national news," he wrote on Twitter.