STANFORD -- Michael Humphrey blocked a shot with 4 seconds remaining and Stanford upset No. 11 Oregon 76-72 on Saturday.
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 Pac-12), 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 time out 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.
Oregon: Chris Boucher and Jordan Bell are helping the Ducks re-write the program's record book for blocks. Bell, the school's all-time leader, set the individual record with 94 last season and the Ducks had a school-record 157. Oregon entered play with 153, and Boucher, who currently leads the nation, had 83.
Stanford: Coach Johnny Dawkins shuffled his starting lineup for the third consecutive game with his ninth different lineup. Seniors Christian Sanders and Grant Verhoeven were in the starting lineup together for just the second time. Marcus Allen was out of the starting lineup for the first time in 20 games and Dorian Pickens started on the bench after making 16 starts.
Oregon: Hosts Oregon State on Saturday.
Stanford: Is at Washington State on Thursday.