The attack happened at a school in Ostroleka, 20 kilometres (12 miles) north of the capital Warsaw, said police, who released a blurred photo of the suspect following his arrest.