BAKERSFIELD, Calif. (KGET) — A former McFarland High School basketball coach pleaded no contest Tuesday to contacting a teenager to commit a sex act.

Fernando Pruneda faces two years in prison and sex offender registration after pleading no contest to the felony. Three other charges, including lewd or lascivious acts with a child under 14, were dismissed under the plea agreement.

Pruneda’s attorney, David A. Torres, said afterward he and Pruneda weren’t pleased with the case’s resolution, but didn’t want to risk a possibly more severe sentence at trial.

“It was obvious the alleged victim’s family influenced the plea deal,” Torres said. However, proceeding to trial could have resulted in a longer jail sentence.”

Attorneys with Chain Cohn Stiles, who represent the teen, said the civil matter can proceed now that the criminal case has been resolved. Attorney Matthew C. Clark said he looks forward to taking Pruneda’s deposition as he continues to seek justice on behalf of his client and family.

“Fernando Pruneda attempted to sell a position on the varsity basketball team in exchange for sex, and this disgusting and abhorrent conduct deserved to be charged as a felony,” Clark said in an email. “We congratulate the Kern County District Attorney’s Office for their perseverance in securing this plea deal. This case is an example of how sexual predators groom their young prey, and that high school personnel, if it were paying attention, would have been aware of this conduct.”

According to court documents, Pruneda tried to get sexual favors from a junior varsity basketball player. The boy told detectives Pruneda massaged him — as well as other players — below the waist. When the boy resisted or told Pruneda to stop, the coach told him “you won’t get varsity,” according to the documents.

The boy also told investigators Pruneda forced him to sleep in the same bed with him during away tournaments. When deputies questioned Pruneda about inappropriate text messages he sent the boy, Pruneda told them he was just joking around.

Pruneda coached boys basketball for 15 years and helped coach baseball.