Teen turned in by grandmother pleads guilty to planning school shooting A high school student in Washington changed his plea on Thursday.

The Washington state teen who garnered national headlines after being turned in by his own grandmother over plans to commit a mass school shooting pleaded guilty to the charges on Thursday.

Joshua O’Connor pleaded not guilty to the charges when he was arrested in February, but submitted a new plea Thursday after coming to an agreement over the charges, according to Seattle ABC affiliate KOMO.

He has been in custody since his arrest on Feb. 14, the same day as the Parkland school massacre, held on $5 million bond.

O'Connor pleaded guilty to three charges on Thursday: first-degree attempted murder, first-degree robbery with a firearm and possession of explosive device. As part of the plea agreement, the prosecutor agreed to drop a weapons allegation on the attempted murder charge, according to KOMO.

"We do believe that it was important for Mr. O'Connor to take responsibility for what he did and be held legally accountable for the steps that he took," said Andrew Alsdorf, Snohomish County deputy prosecutor.

The 18-year-old could face up to 28 years in prison when he faces sentencing in February 2019.

O'Connor's grandmother, Catherine O'Connor, called police in February after discovering her grandson's journal, which outlined a plot to carry out a shooting at Aces Alternative High School in Everett, Washington.

ABC News obtained a 911 call from Catherine O'Connor alerting police to the shooting plot.

"What I'm reporting is I'm finding journal entries from my grandson," Catherine O’Connor told the operator. "And he's planning on having a mass shooting at one of the high schools."

At the time, KOMO obtained court documents detailing his violent journal entries.

“I need to make this shooting/bombing ... infamous," the student wrote, according to the court documents. "I need to get the biggest fatality number I possibly can. I need to make this count. ... I'm learning from past shooters/bombers mistakes, so I don't make the same ones."

When police responded to the house, they found an AK-47 and grenades, police said.

The armed robbery charge O'Connor pleaded guilty to stemmed from robbing a convenience store prior to the arrest for planning the school shooting.

O'Connor was arrested just hours after Nikolas Cruz allegedly opened fire at Marjory Stoneman Douglas High School in Parkland, Florida, killing 17 students and teachers.

ABC News' Courtney Han contributed to this report.