A former Concord police K-9 officer pleaded no contest Friday to stealing prescription drugs from senior citizens and a medical office and was sentenced to jail and a locked rehab facility.

Matthew Switzer, 38, apologized to the victims, his family and friends as he entered pleas in Contra Costa County Superior Court in Martinez to all the charges against him, including two counts of first-degree burglary and one count each of second-degree burglary, fraudulently obtaining prescription drugs and elder abuse.

Switzer, who resigned last month from the department after 12 years, admitted he stole Norco, a pain reliever, from four senior citizens and from a Concord medical office.

Switzer was sentenced by Judge Bruce Mills to 2 1/2 years in county jail, of which he must serve six months behind bars, said Deputy District Attorney Barry Grove.

If Switzer then successfully serves a year in a locked treatment facility, the remainder of the sentence will be suspended, said his attorney Harry Stern.

Stern said his client had been prescribed the drug for an on-duty neck injury and "he got hooked."

"He took a very important step today," Stern said. "He's doing well under the circumstances. The sentence is tough, but it gives him the opportunity to conclusively beat this disease, and I'm confident that he will."