A Cartersville man, whose profanity-laden exchange with a Floyd County superior court judge went viral last year, pleaded guilty but mentally ill to the 2015 murder of his cellmate, the Rome News-Tribune reported Monday.

Denver Fenton Allen, 33, pleaded guilty after Judge Billy Sparks denied a motion in which Allen claimed he killed Stephen Rudolph Nalley in self-defense.

Floyd County Assistant District Attorney Luke Martin told the newspaper Allen used the killing of his much-smaller cellmate to boost his jail reputation.

Allen was sentenced to life without parole.

In a June 2016 hearing, Allen provoked Superior Court Judge Bryant Durham into a heated and expletive-filled exchange in open court that drew national attention.

The 11-minute incident even became the subject of a comedy sketch on an episode of Adult Swim's animated series "Rick and Morty."

At one point, after Durham made a "you look like a queer" remark, the judge challenged the defendant to masturbate in front of him in the courtroom, The Atlanta Journal-Constitution previously reported.

After Durham found Allen in contempt, Allen responded, “I don’t care.”

Durham then sentenced Allen to 20 days for contempt and said if he said anything else he’d add another 20 days for everything else.

“(Expletive) you,” Allen said.

“Forty days,” Durham ordered.

The exchange escalated until Durham ordered Allen to serve 10 years for contempt.

The state judicial watchdog agency ultimately took action against Durham, although the resolution received criticism from members of Georgia’s legal community.

Allen was evaluated in a series of competency hearings over the past year and a half, the News-Tribune reported. Doctors found that Allen had the ability to understand and assist in his defense.

Read more of the story here.

In other news: