Police say Angel Juarez stabbed the principal at the school before fleeing the scene.
Officers arrested Juarez about two miles away from the scene of the stabbing at the Via Center, a private special education school located on Sixth Street near Allston Way.
"We described him as armed and dangerous because the knife was still outstanding. The description we had of him was that the knife was still in his hand," Sergeant Andrew Frankel told ABC7.
A knife was retrieved by officers just a few blocks from the school that matched the description of the weapon used in the stabbing.
Police are still investigating the cause of the incident.