It is the first documented case of a murder of a teacher at a school in Spain since the country returned to democracy after the death of longtime dictator Francisco Franco in 1975, according to Spain's ANPE teachers' union.
The attack, which took place just after classes began, sowed panic at the Joan Fuster secondary school, which has about 500 students and 40 teachers.
"There were screams from another classroom, the teacher went out into the hall. We heard a really loud noise, we looked into the hall and saw the teacher lying on the ground," said Maria Camila Ospina, a 13-year-old pupil.
The boy had a crossbow and a knife, she said, adding that students piled desks and chairs against the classroom door, and ran out to the courtyard when the attacker was far away.