A judge recently sentenced a former Los Angeles County Sheriff’s deputy to three years in prison, 180 days in jail and five years probation for molesting a 12-year-old girl in Costa Mesa in 2015, officials confirmed Monday.

The three-year prison sentence was suspended, according to Bobby Taghavi, deputy district attorney with the Sexual Assault Unit of the Orange County District Attorney’s Office.

The former rookie deputy, 26-year-old Jovanni Argueta, met the girl via an online fantasy computer game that authorities declined to name.

Taghavi said Argueta pleaded guilty on Jan. 11 to lewd act with a minor, attempted sex with a minor and violation of a protective order. He was sentenced the same day.

As part of a plea deal, one count of contacting a minor with intent to commit a specified crime was dismissed. The prosecution alleged Argueta wanted to have sex with the girl.

Taghavi said Argueta must register as a sex offender for the term of his probation. If Argueta violates probation, he will have to register as a sex offender for life.

The court also ordered the ex-deputy to stay away from the now 13-year-old girl for 10 years.

Authorities said Argueta molested the girl between May 1 and Oct. 22, 2015. He met the girl at her school and off campus.

Costa Mesa police received a report on Oct. 22, 2015 about a suspicious man seen on the Costa Middle School campus. The man was gone when officers arrived. He was later identified as Argueta.

Costa Mesa police arrested Argueta six days later at a sheriff’s training facility in Whittier.

Authorities said Argueta violated a protective order when he contacted the victim on or about Nov. 23, 2015.

The Los Angeles County Sheriff’s Department hired Argueta on Aug. 21, 2014. He was no longer a deputy by March 2016.

“He separated from the department on March 18, 2016,” sheriff’s spokeswoman Nicole Nishida said. She didn’t say if the department fired Argueta or if he quit.