UCLA biology and chemistry Prof Charles Knobler said those who knew Prof Klug were in shock and described his colleague as "a very lively, lovable, likeable guy".
Hundreds of heavily-armed police swarmed across the sprawling campus as thousands of staff and students barricaded themselves in classrooms and offices, some using belts and chairs to secure doors, until authorities determined the gunman and victim were dead.
Police work at the scene of a shooting at the University of California, Los Angeles, Wednesday, June 1, 2016, in Los Angeles
Olivia Cabadas, a 22-year-old nursing student, was getting ready to take a quiz in the mathematics building when her classmates began getting mobile phone alerts. Through a window, they could see students rushing down the hallway.
William Klug, professor killed in UCLA murder-suicide
"It was just a little surreal - this is actually happening," Ms Cabadas said. "It was chaos."
Those locked down inside classrooms described a nervous calm. Some said they had to rig the doors closed with whatever was at hand because they would not lock.
Umar Rehman, 21, was in a maths sciences classroom next to Engineering IV, the building where the shooting took place. The buildings are connected by walkway bridges near the centre of the 419-acre campus.
"We kept our eye on the door. We knew that somebody eventually could come," he said, acknowledging the terror he felt.
The door would not lock and those in the room devised a plan to hold it closed using a belt and crowbar, and demand ID from anyone who tried to get in.
Scott Waugh, an executive vice chancellor and provost, said the university would investigate concerns about doors that would not lock, but overall, the response was smooth.