Ny Redding sank two free throws with 5.5 seconds left to lift
Chasson Randle scored 33 points in a losing cause for Stanford (15-6, 6-3 Pac-12), which had its two-game winning streak snapped.
DaVonte Lacy scored 25 points for Washington State (10-11, 4-5), which had a four-game losing streak snapped. Four other players scored in double figures for the Cougars.
Stanford shot just 42.9% in the second half to allow the Cougars to maintain the one-point lead they had at halftime. Washington State shot 60.0% in the second half and 55% for the game.
The teams combined for 76 free throws in a foul-plagued game.
Two free throws by Josh Hawkinson and a long jumper by Lacy gave Washington State a 78-70 lead with 3:32 left.
Stanford's Rosco Allen hit a three-pointer and Anthony Brown sank a pair of free throws to cut the Cougars' lead to 84-83 with 46 seconds left.
Lacy hit one of two free throws for a two-point lead with 36 seconds left.
Allen missed from close range and Ike Iroegbu of Washington State was fouled on the rebound. He made both free throws for an 87-83 Cougars lead with 18 seconds left.
Randle missed on a drive, but Stanford got the ball back on a jump ball. Stefan Nastic scored to cut the Cougars' lead to 87-85.
Redding was fouled on the inbounds play and sank both free throws for an 89-85 lead with 5.5 seconds left.
Dorian Pickens hit a three-pointer at the buzzer for the final score.
In the first, Stanford made three three-point baskets in jumping to a 17-5 lead.
Robert Cartwright's three-pointer, fifth in six attempts for Stanford, pushed the Cardinal lead to 27-14.
Stanford cooled off and Washington State went on a 17-3 run, with seven points by Que Johnson, to take a 37-36 lead on Lacy's three-pointer. The Cardinal was held without a field goal for more than five minutes.