A former student at a Christian college in Oakland, California, has been arrested after seven people were shot dead on Monday.
Five people were pronounced dead at the scene and two others died in hospital. Three others were wounded.
Police named him as One Goh, 43, a Korean who has been living in Oakland.
Police say multiple shots were fired at Oikos University. Television footage showed wounded people emerging from buildings there.
Oakland police chief Howard Jordan says the gunman opened fire in a classroom at Oikos University. He continued throughout the building, leaving a "very bloody scene", Chief Jordan is quoted on the BBC.
"Officers found several victims throughout the classroom, throughout the building."
"There were several people hiding in locked buildings, locked doors behind desks, as you can imagine, very frightened, very scared," Chief Jordan said.
"Some of them were injured so we had to rescue them out. We had to force our way into a number of rooms."
Angie Johnson told the San Francisco Chronicle that she helped a woman with a gunshot wound in her arm.
Ms Johnson told the newspaper that, according to the woman, the gunman stood up during a nursing class, shot one student in the chest at point blank range and then began firing at the rest of the room.
The Oakland Fire Department says it was first notified of the shooting at about 10.50am.
Pastor Jong Kim, who founded the school about 10 years ago, told the Oakland Tribune the shooter was a former nursing student at the college.
He said he had heard about 30 gunshots in the building, adding: "I stayed in my office."
Oikos University is a Korean college. It offers courses in theology, nursing, music and Asian medicine.
San Francisco Chronicle crime reporter Henry Lee says the suspect was detained at Alameda, west of Oakland. The motive is not yet known.
In February, a high school student in Ohio killed three peers and wounded six.