The lethal assault took place on Monday at approximately 9:20 a.m. local time (07:20 UTC) at school in Barcelona's northern Sant Andreu district.

A teenage suspect was detained by regional police shortly after. According to local government sources, the 13-year-old was a student at the school.

Spanish media and police spokesman said it appeared that the attacker had used a crossbow, although this still had to be confirmed.

A student at the school said she had seen the attacker wielding a knife.

"The boy came into our class with a knife and wanted to attack a friend of mine. But he didn't manage to, he left, and we had a chance to run away," she told Reuters TV.

The two teachers and one of two students injured in the attack were taken to Barcelona hospitals. A second teacher was treated for injuries at the scene.

According to Spanish law, minors under the age of 14 cannot be formally arrested or criminally tried. They are only held in specialized centers in exceptional cases.

ksb/jil (dpa, AP, Reuters)