A bystander shot at a man who was attacking an officer outside a gas station, according to the Sheriff's Office in Dawson County, Georgia.

>> Read more trending news

Officials said a deputy was giving the man a ride to a Chevron gas station. The deputy was about to give the man money when the man began to beat the deputy in the face and head with his fist, authorities say.

An innocent bystander saw what was happening and shot at the man, who ran across the street to a McDonald's. Deputies said the man then assaulted a woman at the McDonald's.

Deputies arrested the man at the restaurant.

The injured officer,  the woman and the man were taken to area hospitals.

The deputy was identified as Sgt. Randy Harkness, 52. He is a 24-year veteran of the Sheriff's Office. He has been treated and released from the hospital.

The Georgia Bureau of Investigation is assisting with the investigation.