The attack occurred just after 9:30 a.m., where the boy killed the substitute teacher, police say. Police officials are unsure which weapon caused the man's death.
Gemma Jarque, a student at the school where the attack took place, said that students hid in her classroom after hearing screams from the attack. Jarque and other students left only after a fire alarm was sounded.
"We saw the teacher lying on the floor in a pool of blood," Jarque said.
Two wounded students were transported to hospitals in Barcelona for treatment, while another wounded teacher was treated at the scene.
The 13-year-old police say is responsible for the attacks was described by students as being a loner. "[The boy] didn't have problems but he was kind of a loner .... other students would pick on him," student Paula Amayuelas said.
"He was very disturbed and saying strange and incoherent things," Jose Miguel Company, a spokesman for the Barcelona Prosecutor's office, told AP. Since the boy is under the age of 14, he will not face criminal charges in Spain.
School attacks are very rare in Spain, with police being unable to recall any fatal attacks in the country's recent history. In 2012, there was a failed attempt by a 21-year-old Spanish man who allegedly wanted to imitate the Columbine High School shootings that resulted in the death of 12 students.
A spokesman for the regional police, however, said it was uncertain whether the 13-year-old's attack was an attempt to recreate Columbine, which occurred 16 years ago to the day.