Rashad Green scored on a short leaner with 3.3 seconds left to lift San Francisco to a 66-65 win over No. 24 Gonzaga on Saturday.
Green finished with 16 points, Perris Blackwell added 14 points and 10 rebounds and Michael Williams scored 13 for the Dons (18-11, 8-7 West Coast Conference), who have beaten the Bulldogs each of the past three seasons at home.
Fans in the capacity crowd at War Memorial Gym stormed center court after the buzzer and mobbed San Francisco's players and coaches.
Elias Harris had 21 points and 11 rebounds for Gonzaga (21-5, 11-3) but shot an off-balance airball from behind the 3-point line as time ran out.
The loss dropped the Bulldogs a game behind No. 21 Saint Mary's in the conference standings with two games remaining.
Green's game-winner capped a frantic final 2 minutes, when a referee's inadvertent whistle appeared to cost Gonzaga a possession with 1:07 left.
San Francisco's Cody Doolin had his shot blocked by 7-foot center Robert Sacre, then the Dons made another critical mistake when Williams had his pass stolen by Gonzaga's Cody Hart with 44 seconds left.
After Harris missed a short jumper for the Bulldogs, Cole Dickerson rebounded the ball and got it to Harris streaking down the right side of the court. Green cut through the key and scored to stun Gonzaga for the third straight year.
The Dons, who lost to the Bulldogs 74-63 in Spokane on Jan. 19, overcame a nine-point deficit in the first half and forced 22 turnovers.
Gonzaga coach Mark Few, whose team needed a late second-half surge to beat Santa Clara two nights earlier, shot 51.1 percent from the floor but allowed San Francisco to score 26 points off turnovers.
Instead of controlling their own fate, the Bulldogs now need some help if they're going to win at least a share of their 12th straight conference title.
Green's game-winner for the Dons came after he missed a potential go-ahead bucket in the final 10 seconds of San Francisco's loss to BYU on Thursday.
Early on it appeared the Bulldogs were headed for an easy win.
Gonzaga led by seven early in the first half behind Gary Bell Jr. and the interior defense of Sacre. Coming off back-to-back low-scoring games against Loyola Marymount and Santa Clara, Bell made three 3-pointers and scored 13 points in the first 20 minutes.
When the Dons switched to a full-court press, the Bulldogs struggled to adjust, had trouble getting the ball past midcourt and lost their lead.
Williams scored five points, Green had four and San Francisco went on a 13-0 run to bring the capacity crowd to its feet. Green later made a 14-footer at the buzzer while falling to the floor to give the Dons a 36-33 halftime lead.
The teams stayed close and traded the lead five times before Green's decisive shot.
Bell had 16 points while Sacre finished with 11 points and eight rebounds for Gonzaga.