The 17-year-old accused of planting a bomb-like device at Lafayette's Centaurus High School last year was sentenced to three years of juvenile probation Monday after reaching a plea deal in which prosecutors agreed to drop a charge of attempted murder.

Andrew de Bartolome pleaded guilty in juvenile court to one count of possession of an explosive or incendiary device and one count of menacing.

In exchange for that plea, prosecutors dropped charges of attempted murder, use of an explosive device and one other count of menacing.

Under de Bartolome's probation, he cannot have any contact with the Boulder Valley School District and must graduate high school and attend one year of college.

A suspended detention sentence of 45 days also was put in place should de Bartolome not meet the terms of his probation.

But Boulder District Judge Ingrid Bakke said that based on what she saw in pre-trial supervision, she was confident de Bartolome would do well while on probation.

"You should be proud of yourself," she told the teen. "I hope that this will not derail you."

In court, de Bartolome said bringing the device — which he said was designed so it could not detonate — to school was a "prank," and that he never wanted to hurt anybody.

"I'm very sorry for all the harm I've caused," de Bartolome said. "I acted impulsively and stupidly."

On May 13, 2013, police said an explosive device "very similar to a pipe bomb" was found by a teacher inside Centaurus High, forcing the school's evacuation and the closure of South Boulder Road for several hours.

Officials said the device had a 9-volt battery and could have injured those in close proximity had it exploded. The device was detonated by the Boulder County bomb squad away from the school.

Police identified de Bartolome as a suspect and arrested him later that night at his parents' Boulder home, where police said further evidence linked him to the explosive device.

Boulder County deputies had been called to de Bartolome's house in February 2013 after his parents were concerned he was making explosives in his room, and Boulder County prosecutors said evidence showed de Bartolome had a "long-term interest in explosive devices."

Prosecutors originally planned to try de Bartolome as an adult, but later moved the case back to juvenile court.

Bakke said she credited prosecutors with taking the time to examine the case to make sure it was being filed appropriately.

"They had to be cautions, and I do not fault anything they did," Bakke said. "Clearly there was something going on here. The vilification that took place is not accurate."

Boulder County District Attorney Stan Garnett noted that de Bartolome served about seven months in juvenile detention before being released on bond.

"We are pleased that the case is resolved and that everyone involved in the case -- the defense, the courts, the defendant and everybody on my staff - worked very hard to find a resolution that protected the public and gives this young man an opportunity to move forward with his life in a responsible fashion," Garnett said.

Michael Rafik, de Bartolome's attorney, said that, at the time of the incident, de Bartolome was struggling and had trouble reaching out for the necessary help and treatment, but is a "kind" and "thoughtful" kid.

"Andy scared a lot of people," Rafik said. "Andy understands now when he needs to reach out for help. He had no intention of hurting anyone.

"It's now time to move forward."

Contact Camera Staff Writer Mitchell Byars at 303-473-1329, byarsm@dailycamera.com or twitter.com/mitchellbyars.