A Maryland teen accused of meticulously planning a violent attack at her high school has been sentenced to 20 years in prison after pleading guilty to possessing explosive material with the intent to create a destructive device, authorities say.

Nicole Cevario, 19, of Thurmont was sentenced after entering the guilty plea Tuesday.

Police learned of Cevario's plot after her father read her diary and called the school in March. Within hours of the father's phone call, the honor student was pulled out of a classroom and involuntarily taken to a hospital for a psychological evaluation.

Police believe the diary entries were not empty threats, Sheriff Charles A. Jenkins said at a news conference last year.

"We felt this was going to be carried out. There is no doubt in our minds that we diverted a disaster up there," he said.

Cevario stockpiled bomb-making materials and had a shotgun to attack Catoctin High School, the Frederick County Sheriff's Office said.

The gun and other items were purchased legally, police said. Cevario reportedly planned to saw off the shotgun.

Cevario's diary referenced the horrific school shootings in Columbine, Colorado, and Newtown, Connecticut, Jenkins said. She focused on mistakes those shooters made, the sheriff said.

Also, she said she believed she would be the first female mass shooter.

The diary showed the high schooler, who had been taking college classes in criminal justice and working at a carryout restaurant, had been planning the attack for some time, police said. She expressed frustrations about her personal life and compiled information on the school's emergency procedures and the school resource deputy on duty.

"The journal was very detailed, including a time line that revealed how she was going to execute the plot, and her expectations at each stage of the event," police said.

Investigators say Cevario admitted buying several items to assemble pipe bombs and planned to detonate them at the school, and that she also planned to commit suicide with a shotgun during the attack.