DUBLIN — A San Jose man was sentenced to a three-year probation term after being convicted of arranging to meet an undercover cop who was posing as a 13-year-old girl online.

Aldo Castillo, 30, must register as a sex offender for life as part of his sentencing. Judge Toni Mims-Cochran rejected a prosecution argument to sentence Castillo to four years in state prison, instead giving him two days he’d already served in county jail, plus the probation term, records show.

Castillo was arrested in 2023 after talking online with an undercover Dublin officer who was pretending to be a 13-year-old girl. Their talks started when the “girl” posted something about needing a hair dryer and Castillo joked about getting her one for a sexual favor, according to prosecutors. He was arrested after heading off to a meeting with the purported girl, court records show.

At his April sentencing hearing, prosecutors argued that Castillo “lied multiple times throughout” court proceedings, including during his February trial, where he was convicted of two felonies. The defense argued Castillo endured a traumatic childhood and that prison would “only harm and destabilize” him further.

Castillo is appealing his convictions, court records show.