AUGUSTA — A former Gardiner man who spent three years in a home for juvenile sex offenders pleaded guilty Wednesday to possessing child pornography.

Christian M. Cooper, 22, of Augusta, was ordered to spend two years behind bars, and the remainder of the four-year sentence was suspended. He was placed on probation for six years.

Cooper’s trial had been scheduled to start this week at the Capital Judicial Center. In exchange for his guilty plea, two identical charges, also from Nov. 12, 2014, in Gardiner, were dismissed. The sentencing recommendation was supported both by his attorney, Lisa Whittier, and the prosecution.

The prosecutor, Assistant District Attorney Suzanne Russell, said the charges arose after the Maine State Police Computer Crimes Unit discovered that child pornography was being download and authorities checked the address in Gardiner.

There, Cooper’s mother told Detective Jason Bosco, “If you’re looking for the person with pedophilia tendencies, that would be my son,” Russell recounted Wednesday for Justice Michaela Murphy.

Cooper was arrested Nov. 12, 2014, and has been in jail since then.

Russell said Cooper admitted possessing the pornography, and more than 200 images of child pornography – with children appearing to be younger than 5 – were found on his computer. She said the downloads from the peer-to-peer file-sharing program appeared to begin in 2013 or earlier.

Cooper also told police he sexually molested a young child, but Russell said the state would be unable to successfully prosecute the case because the child was so young and because of when it occurred.

When the judge questioned Cooper about whether he was guilty of the child pornography charge as described by the prosecutor, he first said, “I imagined a vivid dream.” But then he said he was guilty.

Whittier said Cooper “suffers from some pretty serious autism,” but she believed he understood the charge, the consequences of his plea and that it was in his best interest to accept the deal.

Both the attorneys said Cooper had undergone a mental evaluation and had been found competent, although evaluators pointed out that he had some autism.

The judge also told Cooper that he must register as a sex offender for 25 years under the state’s Sex Offender Registration and Notification Act.

Conditions of probation prohibit Cooper from having contact with children under 18. He is also banned from possessing devices capable of accessing the Internet unless approved by his probation officer. Murphy, the judge, asked why there was not a complete ban on Internet-capable devices.

“Mr. Cooper spends most of his time playing video games,” Whittier responded.

In urging the judge to impose the recommended sentence, Russell said that Cooper had no adult criminal record but that he had been housed for three years at a home for juvenile sex offenders. Russell said there were concerns about the early history of Cooper’s behavior and what appeared to be a lifetime addiction to pornography.

“We do believe he is a serious risk,” Russell said.