An 18-year-old Colorado high school student, who shot to death a classmate last year before committing suicide, had planned the attack for months and had written in a journal that he would soon “shoot up my school,” authorities said on Friday.

The new details emerged as police completed their investigation into the rampage at Arapahoe High School, where Karl Pierson fatally wounded 17-year-old Claire Davis.

Armed with a 12-gauge pump action shotgun, a machete and three Molotov cocktails, Pierson stormed the school in the Denver suburb of Centennial on Dec. 13, 2013.

Presenting a report on the investigation, Arapahoe County Sheriff David Walcher said the teenager harbored a grudge against the school’s debate coach, Tracy Murphy, for removing him as captain of its debate team.

Walcher said that when Pierson entered the school, he found Davis sitting outside the library with a friend.

When she asked him what he was doing, Walcher said, Pierson fired three rounds, striking her in the head and back. Davis, a skilled equestrian, died several days later of her wounds.

Pierson then went into the library, the report said, calling out “Where is Murphy?”

When he saw the debate coach, Pierson fired at him twice but missed, it added. Murphy fled and was not hurt.

Walcher also revealed Pierson was evaluated by mental-health professionals after multiple outbursts at the school, but was deemed not to be a threat to himself or others.

Police released excerpts of a diary found on a thumb drive at Pierson’s home in which he said he “lied through his teeth” during one of the evaluations.

In the diary, Pierson warned of “a day of gore” and vowed to exact revenge on people who wronged him.

“I will do something I have wanted to do for a while – mass murder and be in a place of power where I and I alone are judge, jury and executioner,” one entry read.

Investigators also found online searches for school shootings, including at nearby Columbine High School, where in 1999 two students shot dead a teacher and 12 students before committing suicide.

Claire Davis’ parents, Desiree and Michael, attended the briefing, but did not speak.

In a statement they said they forgave Pierson, who they said had become “filled with confusion and darkness” and had failed to see any love around him or hope for the future.