A crazed teen beheaded a schoolmate who he thought had slept with his girlfriend, prosecutors said in court this week.

Mathew Borges was just 15 in November 2016 when he is accused of cutting off the head and hands of Lee Manuel Viloria-Paulino, 16, in Lawrence, Massachusetts.

Borges killed the Lawrence High School sophomore in a jealous rage after accusing him with sleeping with his girlfriend, causing them to split, prosecutors said in Essex County Superior Court on Monday, according to the Boston Herald.

“I think of killing someone and I smirk … It’s all I think about every day,” he texted the girl, according to Assistant DA Jay Gubitose.

“The next time you see me, look at my eyes because that’s the last time they’ll be like that. They’ll be dead,” he texted her before the brutal murder, according to the report.

The following day, Viloria-Paulino went missing and his decapitated body was later found by a man walking his dog.

A state trooper later found the victim’s head in a bag nearby.

Surveillance video showed the two teens walking toward the river, but Borges initially told police they had gone to smoke pot.

But after Borges was arrested, police found a journal at his home with a last entry to call a few friends, wear bags on their shoes and “kill him,” the prosecutor said.

“The defendant told them he stabbed him to death and cut his head and hands off so he couldn’t be identified,” Gubitose told the court, according to the Herald.

Defense attorney Edward Hayden insisted the most Borges can be accused of doing is burglarizing the dead boy’s home — not butchering him.

“Witnesses who are going to say he committed murder are not reliable,” he said.

Borges is now 17 and being tried as an adult on the first-degree murder charge.

His trial continues and is expected to take three weeks.

With Post wires