A student in Washington state was arrested Tuesday after his grandmother called authorities to report "upcoming and credible threats" of a plot in his journal to attack a high school after flipping a coin, officials said.

The Everett Police Department said in a news release the grandmother contacted authorities around 9:30 a.m. and showed police excerpts of the journal, which "detailed plans to shoot students and use homemade explosive devices at ACES High School." Officers were also told by the grandmother that 18-year-old Joshua Alexander O'Connor had a rifle stored in a guitar case, which she discovered after reading the journal.

"That would have probably been one of the hardest calls she has probably ever made, but I think that the content of the journal and some of the other evidence in the house was enough that she was alarmed enough," Everett Police Officer Aaron Snell told Q13 News.

Authorities arrested O'Connor at the school, where he was found carrying marijuana and a knife. During his arrest, the student managed to slip one of his hands out of the handcuffs and tried to run from police, kicking an officer during the attempted escape.

Detectives later executed a search warrant on the grandmother’s house, where he lived and where they seized the journal, a rifle, "military styled inert grenades and other evidentiary items," according to the release.

According to court documents obtained by Q13 News, O'Connor wrote about which high school he would target after flipping a coin. He then wrote that the school, ACES High School located about 30 miles north of Seattle, "won" the toss.

"The best defense against this kind of thing, the school shooting is, that if you hear something or see something is tell authorities. And that’s exactly what she did." — Mukilteo School District spokesperson Andy Muntz

"I'm preparing myself for the school shooting. I can't wait. My aim has gotten much more accurate... I can't wait to walk into that class and blow all those f_____ away," an entry in the journal read, according to the court documents.

RECENT SCHOOL SHOOTINGS IN THE US

The 18-year-old also wrote he wanted the death count to be as high as possible so that the shooting would be infamous, according to court papers obtained by The Daily Herald. His journal entries included details about making pressure-cooker bombs, activating inert grenades and deploying explosives for maximum casualties, court papers said.

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

Another entry in the journal described an armed robbery of a convenience store that police believe O'Connor participated in Monday night. Police said O'Connor admitted to the robbery, telling them he felt powerful during the course of the crime, according to Q13 News. The rifle from the store robbery was the same found in the guitar case at the grandmother's house.

Cash from the robbery was supposed to help fund the school shooting, deputy prosecutor Andrew Alsdorf said in court. The 18-year-old has been booked into the Snohomish County Jail on charges of attempted murder, robbery and assault on an officer, according to jail records.

NIKOLAS CRUZ CHARGED IN FLORIDA HIGH SCHOOL SHOOTING

During a court hearing on Wednesday, public defender Rachel Forde noted the gun and the grenade shells were legal to possess, adding that "musings and ventings" in O'Connor's journal weren't enough evidence to support a charge of attempted murder.

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

School officials on Wednesday said the grandmother set the perfect example for preventing a possible tragedy, the same day a former student killed 17 people at a high school in South Florida.

"The best defense against this kind of thing, the school shooting is, that if you hear something or see something is tell authorities. And that’s exactly what she did," Mukilteo School District spokesperson Andy Muntz told Q13 News. "I know it had to have been really hard for her to do that, to turn in her grandson like that. But she quite honestly probably saved a lot of lives including her grandson."

The Associated Press contributed to this report.