One student still was hospitalized Thursday, and a staff member who suffered a collapsed lung was recovering after surgery, the school said in a statement. Price and another student were treated and released.
Mohammad burst into a second-floor classroom and used an 8- to 10-inch knife to stab two people around the start of an 8 a.m. class, Warnke said.
Price rushed in, distracted the attacker and got stabbed.
"He didn't go in knowing that there was a stabbing taking place. He went in thinking there was a fight," Warnke said during a Wednesday news conference.
The attacker then ran out of the room, down two flights of stairs and outside the building, where he stabbed a school employee sitting on a bench, Warnke said. Mohammad was shot and killed by pursuing officers on a nearby footbridge.
Student Lensy Maravilla, 19, said she was in a biology class on the second floor of the same building when a female student ran in.
Maravilla said the student "was crying hysterically and came in and said that she had seen somebody get stabbed, or slashed, in the throat and she ran."
Classes were canceled until Friday at the university about 120 miles south of Sacramento in the San Joaquin Valley. Police allowed students who live on campus to come and go, but some anxious parents waited in their vehicles at the end of the closed main road to pick up their children.
Among them were Larry and Yen Little, who drove about 110 miles from Elk Grove to get their daughter, Dana. Larry Little said he knows incidents of campus violence are rampant.
"I knew someday it might, but I was just hoping it wouldn't happen here. It's a small campus out in the country," Little said. "Thank God the guy didn't have a gun, shooting people, killing them."
Stabbings involving multiple victims on college campuses have not raised as much alarm as mass shootings because the attacks do not usually result in as many deaths or injuries. Several U.S. colleges have been the site of knife attacks.
A student at Morgan State University in Maryland was charged in March with slashing two other students with a pocket knife outside a campus dining hall. In 2013, a 20-year-old student at a Texas community college wounded at least 14 people during a building-to-building attack.
UC Merced has about 6,000 students and opened a decade ago in the state's farm belt in response to the burgeoning enrollment in the nine other UC campuses. Regents also felt the mainly agricultural region was unrepresented by higher education.
Chancellor Dorothy Leland sought to reassure families that their children would be safe at UC Merced.