Both victims were taken to a hospital with non-life threatening injuries, and the suspects—ages 15 and 17— were quickly arrested after the attack at Magnolia High School, said police spokesman Sgt. Rick Martinez.
Officials said the suspects, both of whom had been expelled from another school, apparently targeted the students and were not authorized to be on campus.
The school was locked down after the attack, but it was lifted after the arrests and students were dismissed on time.
The school has a closed campus and non-students need permission to be on school property, Anaheim Union High School District spokeswoman Pat Karlak said.
"Unfortunately, they got onto campus and they knew who they had a beef with," Karlak said. "We have three security aids. During lunch, they are stationed in the back and the front of the school. It's not an easy task to keep students who don't belong on campus away from the campus, but that is something we are going to address."
Magnolia High has about 1,850 students, Karlak said.