SAN LEANDRO (CBS SF) — Charges have been dismissed against a former San Leandro police officer who had been accused of having sex with a minor he was mentoring because the alleged victim declined to press charges against him, prosecutors said Tuesday.

Marco Becerra, 27, was charged with three felony counts of unlawful sexual intercourse with a minor for allegedly having sex with a 17-year-old girl while instructing her in his department’s Explorer program last year.

READ MORE: San Jose Becomes First City In Nation To Require Gun Liability Insurance

But the alleged victim, who is now an adult, declined to cooperate in the prosecution of Becerra so the Alameda County District Attorney’s Office dismissed the charges against him on June 11, spokeswoman Teresa Drenick said.

Becerra’s lawyer Michael Rains said Becerra “knows he made a mistake,” but he also said Becerra’s involvement with the girl when she was a minor “was a consensual relationship with deep feelings.”

San Leandro police said in court papers last year that Becerra, who worked for the department for three years and lives in San Lorenzo in unincorporated Alameda County, confessed to being in a sexual relationship with the girl last September and October and resigned from his position.

San Leandro police said they began investigating Becerra last Oct. 13 when they received a report from the Alameda County Social Services Agency, which is a mandatory reporter of alleged sexual misconduct.

Investigators said the alleged conduct consisted of unlawful sexual acts with the girl while she was in the San Leandro police Explorer program, which the department offers to youths who are interested in a career in law enforcement.

READ MORE: Curry And Warriors Rout Mavericks, 130-92

Police said the conduct between Becerra and the 17-year-old occurred in September and October while Becerra was off-duty.

Police said Becerra and the girl became friends through the Explorer program and corresponded by phone and social media.

Rains said, “It’s a relief for Mr. Becerra not have criminal charges pending” and said Becerra has “an unblemished record” except for his involvement with the minor.

Rains said Becerra was “an excellent officer” in his short career with the San Leandro Police Department, in which he became a member of its SWAT and emergency response teams, and hopes that he might be able to work for another law enforcement agency at some point in the future.

He said Becerra has been working as an electrician since he resigned from the department.

Rains said he hopes “the story will end happily” for both Becerra and the woman, who “has a great future” and has been accepted at a campus in the University of California system.

MORE NEWS: Oakland Chinatown Cash-Only Businesses Convert To Credit To Stop Attacks On Asians

© Copyright 2018 CBS Broadcasting Inc. and Bay City News Service. All Rights Reserved. This material may not be published, broadcast, rewritten or redistributed.