The decision about where to shoot and kill was based on the flip of a coin.

Authorities said a Washington state teen had been writing about his plans for a mass shooting and said in his journal that he was choosing between two schools, according to probable cause documents.

The court records state his school, ACES Alternative High, “won” the toss.

“I’m preparing myself for the school shooting. I can’t wait,” he wrote in his journal, according to the court records. He added: “I can’t wait to walk into that class and blow all those f‑‑‑ers away.”

Joshua Alexander O’Connor, 18, was arrested Tuesday after police said his grandmother found his journal and called 911 to report “credible threats” by her grandson to shoot students at the high school in Everett, Wash.

During a search at the house on Holly Drive, investigators seized the journal, a cellphone, military-style inert grenades and a Hi-Point 9mm carbine, according to a statement from police. The teen’s grandmother told police that she found the semiautomatic rifle in a guitar case, according to court records.

The grandmother also said that the teen had recently bought the grenades and had written in his journal about “making them live by filling them with black powder,” the court records state.

O’Connor is currently being held on charges of attempted murder in the first degree, robbery and assault on an officer, according to online booking records.

“This is a case where the adage ‘see something, say something’ potentially saved many lives,” Everett Police Chief Dan Templeman said late Thursday in the statement. “It is critically important for community members, to include students and parents, to remain observant and immediately report odd or suspicious behaviors with our children or with fellow students. We were fortunate that a family member believed there were credible threats and contacted law enforcement for further investigation. I’m sure the decision was difficult to make, but fortunately, it was the correct one.”

It was not immediately clear whether the teen has an attorney in the case.

Authorities in Washington are still investigating the events that came to light Tuesday — just a day before 17 people were killed and others were injured in a school shooting in Parkland, Fla.

The police chief in the statement that “there are no known threats to any area schools at this time,” though he added that, at this time, a school resource officer has been placed at ACES Alternative High “out of an abundance of caution.”

Police said in a statement Wednesday that dispatchers received a call early Tuesday morning from a grandmother who said she believed her teenage grandson had plans to launch an attack on his school.

She told police she had read about the plans in his journal.

In his writings, according to the probable cause documents, O’Connor said he was preparing for a school shooting, boasting, “My aim has gotten much more accurate.”

“I’ve been thinking a lot,” he added, according to the court records. “I need to make this shooting/bombing at Kamiak infamous. I need to get the biggest fatality number I possibly can. I need to make this count.

“I’ve been reviewing many mass shootings/bombings (and attempted bombings) I’m learning from past shooters/bombers mistakes, so I don’t make the same ones.”

The journal then mentions the coin flip between Kamiak High School in Mukilteo, Wash., and nearby ACES Alternative High School, according to the court records.

Officers met with O’Connor’s grandmother and were “alarmed at the statements and detailed plans to shoot students and use homemade explosive devices,” according to the statement from police. O’Connor had written in his journal about making pressure cooker bombs “and where and in what order he would be placing his explosives,” according to the court records.

Officers alerted administrators at ACES Alternative High on Tuesday and had O’Connor removed from class, according to the court records. The records state that when searching the teen, officers found marijuana and a knife in his possession and took him into custody.

At the police station, O’Connor “managed to pull his hand from one of his cuffs” and “spun away” from an officer, running through a parking lot, according to the court records. When the officer caught up with him, the court records state, he “spun around on the ground and ‘mule-kicked’ ” the officer.

O’Connor was booked into the Snohomish County Jail on charges of attempted murder “due to planning and taking substantial steps toward executing a school shooting,” according to the police statement.

He was also booked on charges of assault on an officer.

The incident unfolded just miles from Marysville, Wash., where another teenager opened fire in 2014 at Marysville Pilchuck High School. Freshman Jaylen Fryberg lured students around a lunch table and then gunned them down, killing four before killing himself, police said.

Following the news of Tuesday’s thwarted attack, Andrew Muntz, a spokesman for the Mukilteo School District, praised O’Connor’s grandmother for calling the police and turning in her grandson.

“Her actions may have saved many lives and underscores the importance that if you see or hear of something suspicious, you need to notify authorities,” he said in a statement to The Washington Post.

“The school district is also very grateful to the Everett Police Department for their fine work in preventing what would have been a major tragedy.”

O’Connor’s robbery charge stems from an incident Monday in which police were called about two suspects who were robbing a convenience store, according to a separate probable cause document.

Police were told that one of the suspects was armed with an AK-47 and both were wearing masks, court records state.

When officers searched O’Connor’s home Tuesday, they found two masks and a rifle that matched the description, police said.

“Officers also viewed and collected a journal entry from the room that noted that O’Connor admitted robbing an AM/PM. He talked about how powerful he felt and how scared the female cashier was at him pointing his gun at her,” according to the court records.

His bail has been set at $5 million, according to booking records.

This report has been updated.

Read more:

Florida shooting suspect Nikolas Cruz: Guns, depression and a life in trouble

In response to Florida shooting, Trump calls suspect ‘mentally disturbed,’ does not mention gun control

Student who survived Florida shooting pleads with Trump and Congress: ‘Please, take action’

A former GOP lawmaker’s blunt words on gun control: ‘Republicans are not going to do anything’