A student armed with a hunting knife stabbed four people on Wednesday before he was shot dead by campus police at the University of California, Merced, in the heart of the state's Central Valley, law enforcement and school officials said.
The four victims - two students, a campus employee and a construction worker credited with helping prevent more bloodshed - were taken to hospitals for treatment, two by helicopter, though all are expected to make a full recovery, officials said.
The identity of the suspect, a student in his early 20s who lived on campus, was not being publicly released until his next of kin were notified, Merced County Sheriff Vern Warnke told a news conference hours later.
Authorities offered no explanation of a possible motive for the rampage.
Classes at UC Merced, a campus of about 6,600 students, 300 faculty and about 1,000 other staff, were canceled through Thursday, and university officials said they hoped to resume normal operations on Friday.
The violence unfolded at the start of the day as the suspect walked into a second-story classroom and attacked a fellow student with a knife, according to an account by Warnke and campus police chief Albert Vasquez.
A construction worker in the building who overheard sounds of a struggle rushed into the class and was also stabbed before the assailant fled, officials said. Warnke said the worker's actions probably saved the life of the first victim.
Running down a flight of stairs outside the building, the suspect encountered an academic advisor and stabbed her, before stabbing another student.
The suspect was shot to death soon after by campus police chasing him along Scholars' Lane, the main pedestrian walkway through campus, officials said.
A police bomb squad was called to examine a backpack the suspect was carrying, but no other weapons were found, Warnke said.
The campus was placed on a security lockdown as university officials alerted students and staff by social media to stay put until the situation was deemed safe.
The stabbings come about a month after a gunman killed nine people and himself at a college in Oregon, in the deadliest of dozens of U.S. mass shootings over the past two years.
The city of Merced, where the newest addition to the 10-campus University of California system was opened 10 years ago, is located 135 miles (217 km) southeast of San Francisco.