MARTINEZ — A former Oakland Fire Department captain was sentenced to 150 days in jail Tuesday after pleading guilty before a Contra Costa Superior Court judge to one count of possession of child pornography.

Richard Chew, 58, of Lafayette was arrested Sept. 6. According to a search warrant affidavit, Chew allegedly had shared 195 computer files with an undercover sheriff’s deputy a few weeks earlier. At least three of those files, the affidavit said, contained images or video of young children performing sex acts.

Chew, who has been free on bail, is to turn himself in at a later date to serve his sentence. He also will have to serve three years’ probation, and register as a sex offender.

The Contra Costa Internet Crimes Against Children Task Force started investigating Chew in August; search warrants were soon served on Chew’s Lafayette home and at his Oakland Fire Department office. Images of child pornography were found on a laptop computer belonging personally to Chew, and on two flash drives seized by investigators.

Senior Deputy District Attorney Paul Graves would not say Wednesday who or what alerted law enforcement to investigate Chew in the first place.

He was placed on administrative leave by the fire department immediately after his arrest, and subsequently fired after more than 28 years with the department. Chew had been a departmental voice in reporting buildings that were unsafe in the event of fire. In March, just days before a blaze at a San Pablo Avenue halfway house apartment complex, he warned superiors of the dangerous conditions there.

Chew was charged with two counts of possession of child pornography, and ultimately pleaded guilty to one count.

The Contra Costa task force includes detectives and investigators from the Walnut Creek, Martinez, San Ramon, Concord and Moraga police departments, the Sheriff’s office, the county Probation Department and the District Attorney’s office.