ROCKLAND, Maine — A Rockland man who was caught on videotape beating and torturing a boy earlier this year has pleaded guilty.

Douglas Merrifield, 34, of Rockland pleaded guilty Oct. 13 to Class B aggravated assault and a misdemeanor account of endangering the welfare of a child.

The sentence agreement reached between the prosecution and defense calls for a term of seven years in prison with all but 33 months suspended, according to Assistant District Attorney Jeffrey Baroody. Merrifield will also be placed on probation for four years upon his release, the prosecutor said.

Formal sentencing is scheduled for the end of December, Baroody said, but the judge presiding over the case indicated he would accept the agreement.

Merrifield was arrested July 6 by Knox County Sheriff’s Office Detective Dwight Burtis and Detective Lt. Reginald Walker.

According to an affidavit filed in Knox County Unified Court by Detective Burtis, a woman contacted him on May 24 with questions about domestic violence and abuse against children. The woman allegedly told Burtis she was reluctant to report any abuse because the man she was talking about had once worked at the Knox County Jail. She would not provide any additional information, and attempts by the detective to contact her soon after the initial conversation were unsuccessful.

Burtis was able to reach the woman in late June, and she met with him again on July 5 and provided him with a memory stick containing a 62-minute video recording, according to the affidavit. The video was recorded by a home surveillance camera, Baroody said.

The video shows Merrifield attempting to strangle a 12-year-old boy six times within the first 10 minutes of the recording, according to the affidavit. On one occasion, the boy is seen convulsing when he is in a headlock applied by Merrifield. The man then knees the boy in the groin and stomach while the child cries out in pain. Merrifield then makes the boy stand with his head against the wall for the next 50 minutes, according to the affidavit.

Merrifield admitted to putting his hands around the boy’s neck and squeezing but said the child was able to breathe, Burtis reported.

He was held in jail for six weeks before his bail was reduced to unsecured and he was released.

Baroody said Merrifield has no criminal record but that the severity of the abuse warranted the recommended prison sentence.

Merrifield worked for the county jail as a corrections officer for a few years before being dismissed by the county in 2009. The reason for that dismissal was not immediately available Friday from the county.