The student was identified as an undergraduate, Christopher Travis, 32, the Oakland Tribune reported.
Campus police said Travis came to a computer lab with a handgun Tuesday afternoon. When he was approached by an officer, he allegedly refused many orders to drop the weapon.
Chancellor Robert Birgeneau said police and other school employees acted appropriately to protect the campus.
"Our hearts go out to the family of this young man," he said.
Police went to the computer lab at the Haas School of Business after an employee reported seeing a man in the elevator pull a gun out of his backpack and then put it back. When the officers confronted him, Travis allegedly pulled the gun out again and aimed at them.
Campus police Chief Mitch Celaya said the man "displayed" the weapon in "a threatening manner," the San Francisco Chronicle reported.
"The officers, in fear for themselves and individuals around them, fired a shot at the individual, hitting him," the chief said.
The Chronicle reported police said had not determined why Travis, a transfer student in his first semester at the school, had brought a gun to campus.
The officers involved, whose names also were not released, were put on paid administrative leave pending an investigation.
Birgeneau said at least four students were in the lab at the time of the shooting. None were injured, the newspaper said.
The school alerted the campus community via text and e-mail alerts.
The Chronicle said Travis had described himself in online profiles as the operator of a consulting and business services company called Forbisher Group.
"My passion is to help you achieve your goals," the company's Web site states.
Travis called himself a "reformed computer nerd," the Chronicle said.
"I call myself this because when I grew up, all I did was play computer games," he wrote. "I even flunked out of college the first time because I would skip class in order to play computer games in the dorms.
"However, one night I had this dream. It was like I had this vision from god and when I woke up, I had discovered the secret to winning at packman. That was when I decided that I have to do something else with my life."
Travis left his job as a shift supervisor at security company AlliedBarton Security Services voluntarily in April, company spokeswoman Samantha Thomas told the Chronicle. She said the company had "no issues or concerns with him during his employment."
2014: NFL Cheerleaders [PHOTOS]