BERKELEY, Calif. — Cheerleaders danced, grown men hugged and young men jumped.

Fans hopped over the railing and down onto the wooden student bleachers, pouring out of the stands and onto the Haas Pavilion floor.

Down went Frazier. Mighty Ruth struck out. Jerry Rice dropped the winning touchdown pass.

It was utter pandemonium after Cal beat top-ranked Arizona on Saturday night 60-58, ending the Wildcats’ unbeaten streak.

The crowd rushed the court early, with 0.9 of a second left after Justin Cobbs floated in the game-winner, before being ushered back into the too-small student bleachers. After Arizona’s last chance went awry, they sprinted down again.

All Mike Montgomery could do was duck.

“I stay out of the way,” the Cal coach said. “I’ve been in too many of those. Everybody’s rushing the court with 0.9 seconds. I had visions of them passing it in and dribbling it in to beat us.

“As long as I’ve played No. 1, it brings out everybody.”

And again, Cobbs rose to the occasion.

The senior guard, who dropped in a game-winner at Oregon with 0.7 of a second left last season in a two-point win, was put in the same position again.

“It happened before at Oregon; it was exciting for them to do that, show the support,” Cobbs said. “When that crowd is packed like that, we feed off it. It was a great feeling.”

Richard Solomon, who had a crucial 12 points on 6-of-6 shooting in the first half, stood under the hoop as Cobbs let it fly with less than a second left. He jostled for position until he knew he didn’t need to.

“I watched it go through the net and thought, ‘Wow that was pretty,” Solomon said.

And it was, for Cal fans.

A man in a Bears hat high-fived an older usher, and a child on his father’s shoulders smiled from sideline to sideline.

For Arizona, though, not so pretty.

The loss of Brandon Ashley two minutes into the game proved devastating, even if Rondae Hollis-Jefferson filled in admirably and Kaleb Tarczewski proved a rock in the middle.

But the rotation was tilted, and the Wildcats couldn’t make up for it.

“Hollis-Jefferson is a McDonald’s All-American, and he’s a terrific player; he and (Aaron) Gordon are relentless,” Montgomery said. “He gets seven boards, 10 points. Whether Tarc got tired over 35 minutes, whether Gordon got tired — I don’t know if he ever gets tired — I’m not sure.”

Gordon looked tired, at least on the offensive end.

The hometown product went just 4-of-14 shooting from the field, though he added 13 rebounds and six assists. Nick Johnson, though, went just 1 for 14 for four points, plagued by Cal’s relentlessness.

“It’s the same scheme for every good player,” Cobbs said. “Just try to contain them. Good players are going to score points. But we tried to stay in front of them, force bad shots.”

After three straight losses, which followed a 5-0 conference start, there were doubts that the Bears had it in them.

Not among the players, though.

“I just knew that we were a capable team,” Solomon said. “I knew we had a chance to beat them. I texted the guys last night, ‘Lets get it done.”

After helping Cal to the win, luckily, Solomon was able to stay above the fray.

“I was able to breathe a little bit more,” Solomon. “It’s a lot of energy. It’s good getting that much love from the students.”