Images from the scene showed students fleeing and some jumping from windows as police units secured the area.
The attack began around 09:30 local time, with the gunman using a shotgun to fire indiscriminately on campus. At least 16 people were wounded, including 10 students, four teachers, a cafeteria worker and a police officer. The attacker later took his own life as security forces surrounded the building, officials said.