A New York man charged with killing a teenager last summer and posting photos of her body online pleaded guilty to second-degree murder Monday.

Brandon Clark, 21, told an Oneida County Court judge that he thought every day about the "terrible things" he'd done to Bianca Devins, 17, on July 14, NBC affiliate WKTV of Utica reported.

Image: Bianca Devins

"I've thought about Bianca and how she didn't deserve what happened to her," he said, according to the station.

Clark initially pleaded not guilty to Devins' murder. The new guilty plea comes as part of an agreement with the district attorney's office dismissing a prison contraband charge against Clark for allegedly having a sharpened toothbrush while in custody, WKTV reported.

Prosecutors in Oneida County, near Syracuse, said Clark stabbed Devins to death after seeing her kiss another man hours earlier.

Afterward, authorities said, Clark posted photos of her body on the messaging app Discord. He then called 911 and made "incriminating" statements about her killing, police have said.

When responding officers in Utica found Clark lying on the ground next to an SUV, he began stabbing his own neck. After injuring himself, he showed officers a green tarp with Devins' body underneath it, police have said.

Download the NBC News app for breaking news

Speaking Monday, prosecutor Sarah Demillier said she was "relieved" that jurors "don't have to see what Brandon did to Bianca," WKTV reported.

Devins' grandfather Frank Williams told the station that he was "grateful" for Clark's plea.

"He's taking full responsibility that these were his actions, done by him, caused by him," Williams said.