This is an archived article and the information in the article may be outdated. Please look at the time stamp on the story to see when it was last updated.

Moments after being sentenced for sexually assault a 4-year-old girl, a convicted sex offender was captured on video being attacked by another prisoner in the back of a Dover, New Hampshire, courtroom on Thursday.

Christopher Elwell, 29, had just received a prison sentence 7 1/2 to 15 years and went to sit down in the back of the court when he was head-butted multiple times by Josiah Davies, according to television station WMUR in Manchester, New Hampshire. Davies, who was in shackles at the time, was awaiting a hearing on a probation violation.

The two men were unknown to each other, but a Strafford County Attorney’s Office official told the station Davies may have been set off by Elwell’s case.

Elwell sexually assaulted a 4-year-old girl this past June in Dover, when the victim came over to the home where the defendant was staying, according to WMUR.

His 9-year-old daughter witnessed the assault, which occurred at a children’s sleepover, according to an affidavit obtained by NH1 News in New Hampshire. Police said Elwell had been prohibited from being on the property.

“They described him showing them videos of sexual acts similar to the ones that she had done,” Assistant Strafford County Attorney Emily Conant said.

After initially denying the allegations, Elwell admitted they were true when he appeared in court Thursday, according to WMUR. He also pleaded guilty to failing to register as a sex offender.

Elwell was convicted of felony sexual assault on a teen younger than 16 back in 2008, according to NH1 News.

“The defendant was required to register as a sex offender he had been living at 12 Mineral Park Drive off and on but more than five times a month and had not changed his registration with the Somersworth Police Department,” Conant said.

She also told the judge she would have liked him to serve more time for the sexual assault, KMUR reported. But the judge accepted the plea bargain, in part because it would spare the child from having to testify.

The Strafford County Sheriff’s Office is investigating the courtroom incident, saying Davies could face 3 1/2 to seven years in prison.