The incident began unfolding at Castleview Elementary School around 11:15 a.m. Tuesday and lasted at least six hours as officials attempted to negotiate with the man, the Riverside Police Department said in a press release.
That man has been identified as Riverside resident Luvelle Kennon, 27. He died in the hospital after being shot by police.
The teacher involved, 70-year-old Linda Montgomery, was safe after the incident but "traumatized," officers said.
A substitute teacher was also injured when he tried to prevent Kennon from dragging the teacher into the classroom, said Ryan Railsback, a public information officer for the Riverside Police Department.
The incident occurred during the lunch hour and students were not present in the barricaded classroom.
Kennon, who has been referred to as a student's parent, apparently flouted visitor protocol and forced himself onto the campus, then became upset and barricaded himself inside the classroom.
Law enforcement response included a SWAT team, bomb squad, and crisis negotiators.
It's not clear whether Kennon was armed, but police said some type of smoke was observed inside a classroom. Detectives are also looking at a bag he apparently had with him when he arrived at the school.