MILFORD, Conn. (AP) – A teenager accused of stabbing a classmate to death at their high school for rejecting his invitation to the junior prom pleaded no contest to murder Monday, and prosecutors said they will seek a 25-year prison sentence.

Christopher Plaskon, 18, accepted a plea bargain during a brief appearance in Milford Superior Court. Sentencing is set for June 6.

Plaskon was charged with killing 16-year-old Maren Sanchez at Jonathan Law High School in Milford on April 25, 2014. His family and friends said he became upset that Sanchez turned down his prom invitation.

Plaskon was held at a psychiatric hospital after the stabbing. His attorneys were considering an insanity defense.

Plaskon lawyer Edward Garvin said his client suffered from psychosis and called the claim that the stabbing was over a prom rejection “inaccurate.” State’s Attorney Kevin Lawlor, however, said evidence from several sources pointed to the rejection as the reason for the attack.

Garvin said state law would allow Plaskon to apply for parole in 13 years, based on the fact that he was 16 at the time of the killing.

Lawlor said the plea bargain was the best result possible in the case.

“I’ve said it before and I’ve said it to countless families: No number (of years in prison) is going to bring your loved one back. I just hope they can move on and heal,” he said.

Sanchez’s mother declined to comment after the emotional hearing, at which several people wore purple – Sanchez’s favorite color.

The attack happened in a first-floor hallway at about 7:15 a.m. on the day of the junior prom. Students described an emotional scene where people were crying as police and paramedics swarmed the school.

A witness tried to pull Plaskon off Sanchez during the attack, and another saw Plaskon discard a bloody knife, according to an arrest warrant affidavit. Plaskon was taken to the principal’s office in bloody clothing and told police, “I did it. Just arrest me,” according to the affidavit.

Staff members and paramedics performed life-saving measures on Sanchez, but she was pronounced dead at a hospital shortly afterward. The medical examiner’s office said she was stabbed in the torso and neck.

Sanchez, a member of the National Honor Society who was active in drama and other school activities, had been focused on prom in the days before she was killed. She had posted on Facebook a photograph of herself wearing a blue prom dress and was looking forward to attending with a new boyfriend.

At school on the day before the stabbing, Sanchez and a friend talked excitedly about their plans for the upcoming dance.

A friend of Plaskon’s told police that Plaskon thought about hurting Sanchez because he wanted to be more than friends with her. The friend said Plaskon said he wouldn’t mind if Sanchez “was dead or hit by a bus.”