MARTINEZ -- A Mexican national was sentenced Friday to 25 years to life in prison for sex crimes against a 6-year-old Walnut Creek boy in 2010.

Oscar Juarez, 28, was convicted by jury in August of two felony counts of sodomy of a child age 10 or younger and three counts of attempted sodomy of a child age 10 or younger.

The victim, Juarez's relative, was abused while Juarez was staying with family members and working as a laborer to support his mother in Mexico, prosecutor Mary Blumberg said. He was arrested in August 2010.

Judge John Kennedy said the sentence, equivalent to a first-degree murder punishment, was appropriate given the violence perpetrated and the victim's vulnerability. The victim wrote a letter to Kennedy and drew him pictures of two of his favorites things: a car and Diego from "Dora the Explorer."

"I am very scared he will get out because he caused a lot of harm to me, my mom, and my little sisters," the boy wrote.

The child's mother said she was pregnant when she discovered what Juarez was doing to her son, and it nearly caused her a miscarriage.

One of Juarez's brothers said something horrible must have happened to Juarez when he was a child, and no one protected him. Another brother described Juarez as hardworking, devoted to God and said he will always love him.

Juarez did not make a statement.

Contact Malaika Fraley at 925-234-1684. Follow her at Twitter.com/malaikafraley.