Josh Nunes had a touchdown passing and Ryan Hewitt added one on the ground as No. 19 Stanford edged Washington State, 24-17.
Nunes passed for just 136 yards on 7-of-15 attempts while Stepfan Taylor added 58 yards on 21 carries for the Cardinal (6-2, 4-1 Pac-12), who have won their past two.
Jeff Tuel was 43-for-60 for 401 yards, two touchdowns and one interception while Dominique Williams and Kristoff Williams each caught a touchdown pass for the Cougars (2-6, 0-5), who have dropped five straight games.
"Stanford played more mature than we did. The maturity was ahead of us and they won the game," Washington State coach Mike Leach said. "We need to keep growing up, but I thought we improved."
With the game tied to start the second half, the Cardinal began the third with the ball and took the lead.
The team converted three third downs on the drive and the 13th play saw Hewitt punch the ball into the end zone from a yard out to give the Cardinal a 17-10 lead with 8:04 left in the third.
Neither team could get anything going offensively for the rest of the third quarter and the first points of the fourth came from Stanford's defense.
Deep in Washington State territory, Tuel threw a pass that Ed Reynolds picked off and returned 25 yards into the end zone to give Stanford some breathing room, making it a 24-10 game with 10:43 to play.
The Cougars came back with a 12-play, 75-yard drive that saw the team make it a one-score game after Tuel and Kristoff Williams combine for a 10-yard score with 6:29 to play.
Stanford ran off close to three minutes of the clock before punting and Washington State got the ball back at its own 20 with 3:37 to play.
It appeared to be over as the Cougars faced a 4th-and-21, but Tuel found Bobby Ratliff for a 25-yard gain, giving Washington State 1st-and-goal at the 9. However, Tuel was then called for intentional grounding on a sack to push the ball back to the 19 and he was again sacked on the final play of the game.
"One of the things I love about my guys is we play hard. They played hard the whole game," Stanford coach David Shaw said. "We had some guys who made some individual plays that were outstanding, but I think we can play so much better, and we're going to need to."
Stanford's first possession of the game bore fruit as an eight-play, 33-yard march was capped on a Jordan Williamson 42-yard field goal for a 3-0 lead with 8:23 to play in the first.
The score stayed that way until the second quarter when Washington State took the lead. On the 11th play of the drive, from the 3-yard line, Tuel and Dominique Williams got together for a score and a 7-3 advantage with 8:13 left in the half.
Stanford answered quickly as the second play saw Nunes find Jamal-Rashad Patterson for a 70-yard score and a 10-7 lead.
Following a failed fourth down from the Cougars and a three-and-out from Stanford, Washington State found itself at its own 37 with 1:56 to play. That was plenty of time for the team to get into scoring position and an Andrew Furney 24-yard field goal tied the game at the break.
Stanford plays at Colorado next Saturday ... Washington State plays at Utah ... The Cougars finished the game with minus-16 yards on 23 carries ... Stanford has won five straight against Washington State and leads the series, 37-25-1.