PITTSBURG -- A Brentwood man pleaded guilty Tuesday to one felony charge of possessing child pornography and a misdemeanor charge of annoying or molesting a child in August 2009.

Matthew Alvarez, 26, who is free on bail, entered the pleas to Judge Cheryl Mills on Tuesday.

The terms of the plea bargain, which dropped one felony child pornography charge, calls for 180 days in County Jail and five years of felony probation. Alvarez must also register as a sex offender.

He will be formally sentenced at 8:30 a.m. Oct. 31 in Pittsburg.

Brentwood police say that were contacted by investigators in Martinez earlier this year, when they came across information that Alvarez was sending and receiving child pornography.

Brentwood Lt. Ben Tolero said police followed up with a search warrant and, after finding confirming evidence, took him into custody in late April.

"Hundreds" of images were found on his computer, deputy district attorney Alison Chandler said.

While being interrogated by police, Alvarez confessed to a sexual incident in 2009 with a 10-year-old girl that he had previously denied, the victim's father said while reading a statement at the court hearing.

Alvarez, who worked at Best Buy in Pleasant Hill and Brentwood, lived with the family for eight months and was a trusted family friend.

"You took away our daughter's innocence and broke our trust," the father said. "We don't want you to be in jail forever, but we do want you to be in long enough to make an impact on your life."

According to the family, Alvarez was giving the victim a ride home when he started masturbating and encouraged her to watch him.

There are no allegations of sexual touching in the charges, Chandler said.

Alvarez, his attorney and a handful of family and friends with him in the courtroom declined to comment outside the courthouse Tuesday.

Staff writer Malaika Fraley contributed to this story. Contact Paul Burgarino at 925-779-7164. Follow him at Twitter.com/paulburgarino.