Police say he had a rifle and “detailed plans” to kill classmates. His grandmother turned him in.

Joshua Alexander O’Connor, 18, appears in court Wednesday. He is accused of plotting to bomb and shoot classmates at ACES High School in Everett. (Caleb Hutton / The Herald)

EVERETT — A would-be school shooter in Everett bought inert grenades, hid a military-style rifle in a guitar case and carried out an armed robbery to fund an elaborate plot to kill his classmates, according to police.

The grandmother of Joshua Alexander O’Connor, 18, found alarming journal entries Tuesday at her home on Holly Drive, according to reports filed in court. She called police. An officer pulled O’Connor from class at ACES High School to arrest him.

“I’m preparing myself for the school shooting,” he had written in the journal. “I can’t wait. My aim has gotten much more accurate … I can’t wait to walk into that class and blow all those (expletives) away.”

O’Connor wrote that he wanted the death count to be as high as possible so that the shooting would be infamous, according to court papers. He went into detail about building pressure-cooker bombs, activating inert grenades and deploying explosives for maximum casualties.

“I need to make this count,” O’Connor reportedly wrote. “I’ve been reviewing many mass shootings/bombings (and attempted bombings) I’m learning from past shooters/bombers mistakes.”

To her shock, the grandmother found a semiautomatic rifle in O’Connor’s guitar case. She did not know he had a rifle. She called police at 9:25 a.m. Tuesday.

The grandmother showed officers excerpts from the journal. The teen had written about flipping a coin to choose if he would target Kamiak High School or ACES, the alternative school he transferred to in October. His school was picked in the coin flip.

Another entry described an armed robbery of a convenience store. Police believe it was a holdup from 10 p.m. Monday in the 900 block of W Casino Road. Security cameras showed two masked robbers entered the store. One pointed what the cashier thought was an AK-47 rifle, although part of the gun was covered by a sweatshirt, according to court papers.

The pair left with about $100. Cash from the robbery was supposed to help fund the school shooting, deputy prosecutor Andrew Alsdorf said in court Wednesday.

The second robbery suspect has not been identified. Police ask anyone with tips about that person to call 425-257-8450. Or call 911.

In the journal, O’Connor described feeling powerful as he held the cashier at gunpoint, police say. The night of the robbery, O’Connor returned home carrying a guitar case, according to his grandmother’s report. She found a rifle inside the next morning.

On Tuesday police took a glance inside the teen’s room, saw two grenades and left the area to get to safety. Officers applied for a warrant to search the room. The high school was notified and O’Connor was arrested, reportedly carrying a knife and marijuana. A search of the home led to recovery of the journal, a rifle, the grenades, masks and a green-and-black jacket said to match one worn by the gunman in the convenience store.

O’Connor admitted to the robbery, police said. Officers took him to the south Everett precinct, where he reportedly managed to slip one hand free from handcuffs. He ran, but fell. He “mule-kicked” an officer when police tried to cuff him again, according to the reports. O’Connor was booked into the Snohomish County Jail for investigation of attempted first-degree murder, felony assault on an officer and first-degree robbery.

Police believe O’Connor planned to die in the school shooting.

So far, the investigation of the plot has focused on a single suspect. Detectives are still working the case. Among other things, they’re trying to figure out if the second robber knew about O’Connor’s plans for the high school, officer Aaron Snell said.

Midway through February, the United States has seen six school shootings in 2018. The latest national tragedy unfolded in the opposite corner of the country Wednesday, when an ex-student opened fire at Marjory Stoneman Douglas High in Parkland, Florida. Seventeen people were reported as dead.

Mass shootings on and off campus have left scars in Snohomish County, too. In October 2014, a freshman at Marysville Pilchuck High School killed four teenagers — Shaylee Chuckulnaskit, Andrew Fryberg, Zoe Galasso and Gia Soriano — before taking his own life.

A man, 20, killed his former Kamiak High School classmates, Anna Bui, Jake Long and Jordan Ebner, at a house party in July 2016. The shooter was sentenced to life in prison.

On Wednesday in court, Alsdorf told a judge that O’Connor bought a rifle because it was the same style as a gun used by one of the shooters at Columbine High School in 1999.

A public defender, Rachel Forde, noted the gun and the unarmed grenades were legal for O’Connor to possess. She argued that the “musings and ventings” in the journal weren’t enough evidence to support a charge of attempted murder.

A judge, however, found probable cause to hold O’Connor in jail on the three felony counts. Bail was set at $5 million.

O’Connor had enrolled at Kamiak High School for the 2016-17 school year, according to the Mukilteo School District. He did not show up at the start of the school year and later transferred to ACES, at 9700 Holly Drive in south Everett.

School officials learned of the threat Tuesday.

“Our main thing right now is gratitude, especially to the grandmother,” said Andy Muntz, a spokesman for the Mukilteo School District. “That couldn’t have been easy for her to do. The Everett police also did a wonderful job. That combination may have saved a lot of lives.”

Students can choose to attend ACES instead of their home high school, Mariner or Kamiak. Roughly 200 students attended the campus last May, according to state records. The alternative school offers smaller class sizes for students who are behind in credits or at risk of dropping out.

Scott North and Eric Stevick contributed to this story.

Caleb Hutton: 425-339-3454; chutton@heraldnet.com. Twitter: @snocaleb.