STANFORD — Marcus Lee insisted his confidence never wavered, even as Cal stared at a 17-point deficit with 9½ minutes remaining.
Coach Wyking Jones was a little more realistic and was just hoping the Golden Bears could make a few defensive stops to get their offense going.
Jones got his wish down the stretch with a flurry on both ends that gave Cal a much-needed win after a non-conference slate full of disappointment and lopsided losses.
Justice Sueing scored eight points in the final three minutes and Cal rallied from 17 points down in the second half to stun Stanford 77-74 on Saturday night in the Pac-12 opener for both teams.
"Really proud of my guys and the staff for the fight and not throwing in the towel, just staying with it and chipping away," Jones said. "We've been in this situation a couple times this year and found a way tonight."
It wasn't easy and certainly not foreseeable.
The Bears (7-7, 1-0) looked listless and out of sync for most of the game and trailed 65-48 but outscored the Cardinal 27-8 over the last 7½ minutes to win at Maples Pavilion for the first time since 2014.
Sueing fueled the comeback with a pair of three-point plays, both coming as part of an 18-4 game-ending run by Cal. Darius McNeill and Grant Anticevich added 3-pointers during the run and Don Coleman made a pair of free throws with 17 seconds left.
Sueing finished with 18 points, Marcus Lee had 19 points and seven rebounds, Coleman scored 15 points and McNeill added 13 for Cal.
"Early in the season we'd get down and we just stayed down and we wouldn't try to pick back up," Sueing said. "Staying together, we got the win tonight. It's a huge boost of confidence for all of us. We showed what we can do when we stay together."
Dorian Pickens scored 13 points in his return after missing seven weeks with a foot injury but missed two shots down the stretch for Stanford (6-8, 0-1). Michael Humphrey added 15 points and 13 rebounds, Reid Travis had 15 points and eight rebounds, and Kezie Okpala scored 11.
"Just weren't able to get stops," Pickens said. "When you're not able to get stops, it'll kill you."
It was the first time since 1971-72 that both teams entered conference with a losing record.
Cal certainly played to that theme early and looked like it was headed for another loss before the Bears made their late surge.
It was a much-needed shot in the arm for Jones' team, which has suffered losses to UC Riverside, Chaminade, Central Arkansas and Portland State this season.
"Once we cut it below 10 I felt like we had a great chance to win if we could just get stops," Jones said. "We were scoring. It was just about getting stops."
Stanford shot well early and had little trouble scoring against Cal's zone defense. Travis had six points as part of a 13-0 run and Robert Cartwright made a 3-pointer to cap an 11-4 run.
The Cardinal also held the Bears scoreless for two long stretches that covered more than nine minutes.
Lee, a 6-foot-11 transfer from Kentucky, scored Cal's first four points but struggled the rest of the first half after picking up a pair of charging penalties that limited him to eight minutes.
Jones took his team out of the zone with about five minutes left in the second half and had the Bears play man-to-man defense the rest of the way. "Made a huge difference," Jones said. "Once our guys got settled in and saw what they were trying to do, we did a better job of containing our men off the dribble."
Cal: The Bears were on the verge of being held to a season-low for scoring in the first half before two late baskets pulled them within 37-24 at halftime. . McNeill was called for a technical foul midway through the second half.
Stanford: Pickens returned after missing 11 games with a left foot injury. . At one point in the first half the Cardinal had four freshmen on the court.
Cal: Plays USC at Haas Pavilion on Jan. 4.
Stanford: Hosts UCLA on Jan. 4.