A Bakersfield man Thursday was accused of attacking a police officer who tried to stop him from allegedly assaulting his girlfriend.

Around 7:40 p.m., a woman in the 700 block of Chester Avenue waved down a police officer and told him a woman was being assaulted in the 700 block of K Street, according to a news release.

When the officer arrived on K Street a number of bystanders directed him to where Pedro Torres Hernandez, 58, was allegedly assaulting the woman.

The officer confronted Hernandez, who was swinging a large flashlight and refused to comply with orders. Another police officer arrived to help and Hernandez allegedly attacked one of them, causing a minor injury. More officers responded and eventually took Hernandez into custody.

He was taken to a local hospital for treatment of injuries sustained during his arrest and apparent drug influence.

He was arrested on suspicion of spousal abuse, assault with a deadly weapon on a police officer and felony resisting arrest.

The woman was Hernandez's live-in girlfriend. She was injured but declined medical treatment.

Hernandez was on Post Release Community Supervision at the time of his arrest.

Anyone with information on the case is asked to call the BPD at 327-7111.