Michael Humphrey blocked a shot with 4 seconds remaining and Stanford upset No. 11 Oregon 76-72 on Saturday in Stanford, California.
Marcus Allen hit two free throws with 3 seconds to seal the win for the Cardinal, who ended a season-worst four-game losing streak.
Dillon Brooks scored 18 of his 24 points in the second half for the Ducks (20-6, 9-4), who lost at California on Thursday night.
Rosco Allen matched his career-high with 25 points to lead Stanford (12-11, 5-7). Dorian Pickens scored 10 of his 16 points in the second half and Grant Verhoeven finished with a career-high 13 for the Cardinal.
Tyler Dorsey added 14 points and Elgin Cook had 11 for the Ducks, who came to the Bay Area riding a six-game winning streak.
Cook hit a layup with 18:24 remaining to play to bring the Ducks within 34-33. The Cardinal followed with a 9-0 run, punctuated by a 3-pointer from Rosco Allen to push the lead to 43-33 at the first media timeout.
Stanford was ahead 67-56 with just under 5 minutes to play when Brooks hit a 3-pointer and Oregon called a timeout to set up its press.
The Ducks forced two turnovers and Dwayne Benjamin turned a steal into a layup to make it 69-65 with 3:17 left.
It was still a four-point game when Pickens hit one of two free throws before Brooks hit a 3-pointer to make it a two-point game with 1:23 remaining.
Following a missed Stanford layup, Brooks made two free throws to tie it at 72 with 51.8 seconds left.
Tyler Dorsey hit a shot at the buzzer to bring the Ducks within 32-28 at halftime. Neither team led by more than six points in the half.
Cal 83, Oregon State 71: Tyrone Wallace made seven free throws over the final two minutes to offset an otherwise sloppy day at the line for the Golden Bears, and California remained undefeated at home this season with a win over the Beavers in Berkeley, California.
Jabari Bird had 23 points and seven rebounds to lead four Cal players in double figures. Wallace finished with 17 points, Jaylen Brown added 15 while Jordan Mathews had 14.
Coming off a blowout of No. 11 Oregon two days earlier, the Bears (17-8, 7-5) missed 18 of their 44 free-throw attempts and blew most of a 15-point lead in the second half before holding on for their 17th consecutive win at Haas Pavilion dating to last season.
Tres Tinkle had 22 points and five rebounds for Oregon State (15-9, 6-7).
Subscribe to the sports newsletter
Get the day’s top sports headlines and breaking news delivered to your inbox by subscribing here.