A Walnut Creek police officer pleaded no contest to wearing a mask and beating a woman with a baseball bat, local California news site KTVU reported Monday. Gregory Thompson, 54, entered the no contest pleas in Contra Costa County Superior Court for felony vandalism, felony assault with force likely to cause great bodily injury, and being armed in the commission of the crimes.

Thompson went to his father’s vacant home early Aug. 16, aware the house had recently been burglarized, Deputy District Attorney Barry Grove said. "We can prove he went down there because people had been breaking into his father's vacant house," Grove said, according to Contra Costa Times. "He found a woman on the street. It appears he in some way believed that she was attempting to break into the house and seek shelter, and with a ski mask and gloves, he beat her with a baseball bat."

When he saw an unknown woman walking near the home, he put on a ski mask and "he took the law into his own hands and beat her with a baseball bat," Grove said. The woman’s car ran out of gas and she was walking to a nearby gas station, prosecutor’s said.

Thompson was not wearing a police uniform or in a patrol car at the time of the assault. When police arrived they discovered a mask, a baseball bat, two guns and two zip ties in his car.

The victim hid in the bushes until authorities arrived. She was taken to the hospital and is expected to recover from her injuries. A second woman was reportedly hurt after she tried to intervene, but authorities could not locate her.

Thompson, who is a 30-year Walnut Creek police veteran, could face up to five years in prison, KTVU reported. The prosecutor is reportedly asking for one year in jail. "To his credit," Grove said, according to Contra Costa Times, "he admitted guilt early. Hopefully, he can get on with the rest of his life." His sentencing is scheduled for Oct. 10.

He was placed on administrative leave soon after his arrest and the Walnut Police Department is conducting their own investigation. Thompson officially retired on Friday, three days before he was convicted, the police department confirmed to KTVU. It’s unknown if Thompson will receive his full retiree and pension benefits from his 30 year career.

Follow me on Twitter @mariamzzarella