HARRIS COUNTY, Texas -- Houston police say an officer shot a K-9 after the dog attacked him during a chase Wednesday afternoon in north Houston.

The animal will recover, but because of his age, the K-9 will have to retire, police said.

The incident occurred around noon Wednesday in the 1500 block of Gears Road, not far from Ella and Beltway 8.

Police were patrolling an apartment complex in north Houston for a stolen vehicle involved in an aggravated robbery with a deadly weapon.

They tried to make an arrest at a nearby McDonald's, but police say the suspects sped off in the stolen vehicle.

A short chase began, and the stolen vehicle rammed into the K-9 officer’s car. The chase ended in a field, and both suspects ran from the scene. Two suspects -- a male juvenile and a female juvenile -- were arrested. The female juvenile was found to have a gun, police said.

Photos: Police dog shot after chase in N. Houston

Officials say during the chase, the K-9 attacked one of the officers, latching onto his thigh. Authorities say the dog would not let go, and the officer shot the dog twice.

Officer Castillo, an 8-year veteran with HPD, was taken to Houston Northwest Medical Center with dog bite injuries.

Jake, the K-9, was transported to Aldine Bender Animal Hospital where he underwent surgery. After surgery, the K-9 was transported to BluePearl Veterinary Hospital where he is recovering.

Police say at this time, it is unclear whether the officer thought it was a stray dog or a police dog latching onto his thigh.

Raw video: Police dog shot after chase in N. Houston