SEATTLE -- A 10-year-old Washington state boy was sentenced on Wednesday to up to 5 1/2 years in a juvenile detention facility for his role in a foiled plot to rape and kill a girl at his school and harm other children.

The boy was charged with conspiracy to commit first-degree murder, juvenile firearm possession and witness tampering in connection with a plot in February at an elementary school in Colville, in the state's northeast.

Prosecutors said he pleaded guilty last month to all charges.

Stevens County Superior Court Judge Allen Nielson sentenced the fifth-grader to a minimum of just over three years in juvenile detention and a maximum of nearly 5 1/2 years, Stevens County prosecutor Tim Rasmussen said.

An 11-year-old boy accused of joining in the plot is charged with conspiracy to commit first-degree murder, possession of a dangerous weapon in the form of a knife at school and tampering with a witness, Rasmussen added.

The 11-year-old suspect faces a court hearing later this month.

The 10-year-old boy will serve his sentence at the Echo Glen children's juvenile center in Snoqualmie, Wash., 45 miles east of Seattle. As of Thursday he had already spent nearly 100 days in a local juvenile detention facility, Rasmussen said.

The boy told investigators he and his friend had planned to kill a former fifth-grade girlfriend because she was "rude" and "always made fun" of him and friends, according to court documents.

They plotted to entice the girl away from their elementary school, the court papers stated.

The 10-year-old had taken a Remington Model 1911 pistol that originally belonged to his grandfather from his older brother's room, according to court records.

The boys had also packed ammunition and a knife, but they were stopped on Feb. 7 shortly after they boarded a school bus, Rasmussen said.

A fourth-grade student spotted the knife and reported it to a teacher's aide, Rasmussen said. The names of six other targeted classmates were on a list the boys had, Rasmussen said.

Related:

Prosecutors: 5th-grade boys plotted to kill classmate

Ex-con accused of killing grandparents in custody

Wash. inmates help rescue boys from creek