MODESTO (CBS13) — A Modesto Police Officer is in critical condition after being shot late Saturday night while helping serve a search warrant.

The suspect, who received minor injuries when officers returned fire, was treated at a local hospital and released back into police custody. He was arrested for various weapons violations and three counts of attempted murder of a police officer.

READ MORE: Footage Released Of Carjacking Suspect's Assault On Sacramento Sheriff's Deputy

He was identified as 42-year-old Jesse James Brooks of Modesto.

It started when a traffic officer observed a motorcyclist driving recklessly near West Orangeburg Avenue and Enslen Avenue around 10 p.m., according to Modesto Police.

When the officer attempted to stop the motorcyclist, he fled.

READ MORE: President Biden Releases Federal Funds To Aid Fire Hose Shortage In California

The Stanislaus County Sheriff’s helicopter responded and located the motorcyclist as he continued to flee, following the rider to a residence in the 3100 block of East Orangeburg Avenue. Officers arrived, and soon after say the suspect exited the house and surrendered.

The suspect was searched and found to be in possession of drugs for the purpose of sales, according to police.

Based on the evidence found, officers obtained a search warrant for the residence but when they began to search the house just after 11:30 p.m., a male adult, later determined to be Brooks, began shooting at them, striking one of the officers, according to police.

The injured officer, identified as Michael Rokaitis, was transported to a local hospital where he is listed in critical, but stable condition at this time.

MORE NEWS: Thief Takes Off With Antelope Woman’s Bright Yellow Cotton Candy Trailer

This is an ongoing investigation, and more information will be released when it becomes available.