Police arrived at the boy's home in Wąbrzeźno at 6 a.m. local time on Monday after receiving a tip-off overnight.
He was found with a bayonet in his school bag and a cleaver at home.
A police spokeswoman said he had admitted planning to attack random people at his school and had also killed several cats over the summer.
Officers said they were alerted after the boy shared his plans with an international group of gamers, one of whom reported him to police in another country.
He is also alleged to have belonged to extremist groups on social media.
A family court in Wąbrzeźno ruled on Tuesday that he should be placed in a youth care facility, following an interview with the boy and his father on Monday.
Psychologist Piotr Toczyski told Polish Radio that teenagers were "particularly vulnerable to extremist ideologies online," and urged parents to pay attention if a child became withdrawn or secretive about their interests and contacts on the internet.
The local authority in Książki, the boy's home municipality, said support was being provided to pupils and parents, and that it remained in contact with the police.
(ał)
Source: PAP, IAR