A Spanish student reportedly armed with a crossbow and a knife has killed a teacher and injured four others at a school in Barcelona.

The unidentified boy, who local media say is 13, was arrested after the attack that also saw two other teachers and two students injured.

The incident took place in a working-class neighbourhood of Spain's second largest city.

"We were just starting the class and suddenly we heard screams," said student Gemma Jarque. "So we shut ourselves inside our classroom in order to be safe."

A regional police spokeswoman said the teacher was attacked with a weapon that had a blade, but would not say what exactly was used.

Spanish National Television and other Spanish media reported that the boy had a knife and a crossbow when he entered the school.

Another student, Paula Amayuelas, said she knew the suspect and that he "didn't have problems but he was kind of a loner. Other students would pick on him".

The two injured students and one of the injured teachers were taken to Barcelona hospitals for treatment while the other injured teacher was treated at the scene and did not need to go to hospital.

After the attack, parents and students gathered in silence outside the school for students ages 12-16, hugging each other. Students said the teacher killed was a substitute working at the school for about a week.

A spokesman for regional police said it was too early to determine whether the attack was an attempt to copy the April 20, 1999 attack in Columbine, Colorado, in which 12 students and one teacher were killed.

Police in Barcelona did not identify the suspect because of his age.

In Spain, children under 14 are not held legally responsible for crimes and cannot be jailed or placed in juvenile detention centres.

They can be sent to mental health institutions, said a spokesman for Spain's Justice Ministry.

mfl