Officers are patrolling schools, speaking with pupils and staff about safety, and checking reports of threats.
Cybercrime units are monitoring online activity around the clock, according to officials. Police say threats must be taken seriously even when those behind them claim they were joking.
The detentions have been reported in the east-central Mazowieckie province, which includes Warsaw, the Wielkopolskie region in the west, the Lublin region in the east and Warmia-Masuria in the northeast.
In Mazowieckie province, police said 11 teenagers had been detained over online threats or incidents involving knives and other dangerous items.
Two 15-year-olds from Ciechanów, about 100 north of Warsaw, came forward with their parents and admitted posting threatening videos, saying they had meant them as a joke.
In the Wielkopolskie region, five teenagers aged 14 to 16 from the cities of Poznań, Konin, Międzychód and Września were detained over videos showing masked people with knives or machetes.
Police said their findings indicated that the teenagers had not intended to carry out the threats, state news agency PAP reported.
In the city of Płock, 110 km northwest of the capital, police detained a 13-year-old girl who posted a video in a closed group in which she threatened to kill pupils at several schools in the city.
In Warmia-Masuria, the province bordering Russia's Kaliningrad exclave, three pupils were detained in the towns of Szczytno, Ełk and Bartoszyce. They included an 11-year-old who had brought a fake knife to school and a 16-year-old who had posted a video threatening an attack on a secondary school.
In the Lublin region, near the border with Ukraine, police detained a 15-year-old in the town of Chełm over threatening social media content and a 13-year-old in Tomaszów Lubelski who had threatened in a class messaging group to attack pupils with a knife.
A 17-year-old suspected of creating an AI-generated video threatening an attack at a high school in the north-central city of Przasnysz was charged and placed under police supervision.
Education Minister Barbara Nowacka said on Friday that 59 schools had cancelled classes nationwide. Other schools had tightened entry procedures.
The security measures followed two knife attacks in Mazowieckie province.
On Thursday, a 15-year-old former student attacked three people with a knife at a primary school in the village of Leszczydół-Nowiny, near the town of Wyszków, some 50 km northeast of Warsaw, killing a 37-year-old school caretaker and injuring the principal and a teacher.
A day earlier, a 19-year-old attacked schoolmates and teachers at a vocational school in Ostrołęka, 120 km northeast of the capital, injuring five students, two teachers and two bystanders.
Prosecutors said the suspect also attempted to detonate a homemade explosive device at the school.
On Wednesday, police in the town of Sierpc, 125 km northwest of Warsaw, foiled a planned school attack and detained a 17-year-old who had told classmates he planned to "do something bad at school," according to authorities.
Reports of a possible online challenge circulating among pupils are being investigated, but authorities have not established a link between such a challenge and the attacks.
"Perpetrators of attacks at schools do not always behave aggressively beforehand. They may be withdrawn, have low self-esteem and feel rejected,” Justyna Soroka, a clinical psychologist at the Municipal Hospital in Gliwice, southern Poland, told reporters.
Police urged people not to spread unverified information and reminded the public that threats to trigger an alarm or commit a crime can have serious legal consequences.
(sp/gs)
Source: PAP