NAMPA, Idaho — A 17-year-old Idaho student has pleaded guilty to stabbing his ex-girlfriend in the parking lot of a Nampa high school.

Wyatt Weist pleaded guilty Tuesday to attempted first-degree murder after reaching an agreement with Canyon County prosecutors.

Weist stabbed the 17-year-old victim seven times in the parking lot of Columbia High School in early December, authorities said.

The girl survived the attack and was treated for wounds to her chest, abdomen and arms. She was released from the hospital later the same day, authorities said.

“I attempted to kill the victim by stabbing her,” Weist said when asked by Judge Bradley S. Ford at the Tuesday hearing.

Weist was charged as an adult. Prosecutors dropped the charge enhancement of deadly use of a weapon as part of the plea deal. The enhancement would have doubled the maximum sentence to 30 years in prison.

“I knew what I was doing, and I intended to do it,” Weist told the court.

When asked to describe the weapon used in the attack, Weist told the court he used a single-edge long knife.

According to police documents, Weist and the victim had gotten into an argument prior to the attack. The victim had broken up with him a couple months before.

Weist is scheduled to be sentenced in July. He is facing a sentence of up to 15 years in prison.

Nampa police had credited Antonio Ballesteros, 17, with saving the victim’s life. The Columbia High School student had grabbed Weist’s wrist and knocked the knife out of his hand, police said.