BERKELEY, Calif. (AP) -- An alleged gunman who was shot by police on the University of California, Berkeley campus died at a hospital hours after the confrontation, a university spokesman said Wednesday.

The man was an undergraduate transfer student in his early 30s who was attending classes at the Haas School of Business, spokesman Dan Mogulof said.

University officials said a female staff member saw a man carrying what appeared to be a gun in an elevator at the business school after 2 p.m. on Tuesday. The staff member called police at 2:17 p.m., saying she saw the man remove the gun from a backpack.

Police officers tracked the suspect into a Haas computer room. The suspect raised the gun and was shot by an officer at about 2:22 p.m., roughly five minutes after the initial call, according to the school.

At the time, four students were between the officer and the suspect, UC Chancellor Robert Birgeneau said Tuesday. None of the students was hurt.

Shortly before 3 p.m., the university issued a campus alert about the shooting to students, saying "everything was under control." Another at 3:03 p.m. said one suspect was in custody.

It was the first shooting since the 1980s on the campus, police said.

Mogulof said Wednesday that the suspect was taken to an Oakland hospital, where he died later Tuesday. Mogulof did not release the man's name.