The shooting occurred at the Haas School of Business on the east side of campus about a half-mile away from the protest site.
Ute Frey, a spokeswoman for the university, said officials did not yet know whether the suspect was part of the Occupy Cal movement.
University officials said a man carrying a gun was seen by a female staff member in an elevator at the business school after 2 p.m. The staff member called police at 2:17 p.m., saying she saw the man remove the gun from a backpack.
Police said they arrived at 2:19 p.m., and had to locate the suspect in the building. Officers found the suspect in a third-floor computer room where there were at least four students, university officials said.
The suspect raised the gun and was shot by an officer, according to the school. At the time, the four students were between the officer and the suspect, said UC Chancellor Robert Birgeneau at an afternoon press conference.
None of the students were hurt. No further details were immediately released on the shooting.
The condition of the suspect was not immediately known. A campus alert saying there was a shooting at the business school was sent at 2:56 p.m., 39 minutes after the initial report, saying "everything was under control." A second alert was sent at 3:03 p.m. saying one suspect was in custody.
No further details were released.
It was the first shooting since the 1980s on the campus, police said.
"This is extraordinarily upsetting," Birgeneau said.
The officer involved was placed on paid administrative leave, as is standard procedure in officer-involved shootings.
The shooting occurred as anti-Wall Street activists were preparing another attempt to establish an Occupy Cal camp after a failed effort last week led to dozens of arrests.
ReFund California, a coalition of student groups and university employee unions, called for a campus strike, and protesters planned a rally and march to protest banks and budget cuts to higher education.
More than 1,000 students, campus employees, faculty and other demonstrators filled an outdoor plaza after many took part in morning teach-ins.