Peter Ruiz, 33, pleaded guilty to the charge in October in U.S. District Court in Riverside.
He was originally charged with eight counts - one count each of production of child porn, possession of child porn and receiving child porn, and five counts of distributing it.
But Ruiz made a plea deal that included dropping seven of those counts at the time of his sentencing.
"The family was pleased with the 25-year sentence," Assistant U.S. Attorney Priya Sopori said after the hearing.
Between June 1, 2009, and Nov. 1, 2009, Ruiz befriended the 13-year-old boy who lived near his family's apartment in San Bernardino, Sopori said.
Ruiz took the boy back to his residence on Adams Street several times and enticed him into sex acts.
Ruiz took photos and videos of the victim, which he uploaded to the Internet.
In October 2010, federal agents served a search warrant at the house and found computer hard drives containing thousands of images of child porn.
Investigators determined Ruiz had 67 videos and 789 images involving identifiable victims.
Ruiz was on probation when the offense happened, Judge Virginia A. Phillips said.
Before the judge made her ruling, Aaron shed light on the defendant's own troubled past - how Ruiz had been abused and raped as a child and was "sick emotionally, physically and spiritually. "
"With a sentencing of this type, we need to look at the whole person," Aaron said to the judge.
Ruiz was given the chance to address the court as well.
He apologized to the judge and said he wanted to improve himself.
"This is not who I am; this is what someone made me," Ruiz said. "I'm very sorry for everyone. "
Ruiz has additional victims, officials said.
During the hearing, the mother of two boys who were molested by Ruiz five years ago was given a chance to speak.
The woman, who did not want to give her name, said she trusted Ruiz to take her 9- and 10-year-old boys to the mall or to the park to play. But she soon became suspicious of his behavior.
"It made no sense that a 28-year-old man wanted to be around my children so much, so I told him he could not come around anymore," she said.
The woman said she later found out he would take showers and have sex with her boys.
Since then, she said she has seen a change in her children.
"He stole the smile from their faces," she said about Ruiz.
"He stole their lives. "
There were multiple victims in this case, Sopori said, but Ruiz was sentenced based on the actions with the 13-year-old boy only, not the other two victims.
San Bernardino County officials filed a criminal complaint against Ruiz in 2011, charging him with 23 counts of lewd and lascivious acts with a child.
The violation date for the crimes is listed as Sept. 4, 2009, in court records.
That case is still pending in San Bernardino Superior Court, and there are no court dates scheduled.
Officials said three victims are involved in those charges, including the boy in the federal case.
Reach Lori via email, call her at 909-483-9378, or find her on Twitter at @IEcourtsNow.