CORVALLIS, Ore. (AP) There was no reason for any doubt when Jet Toner stepped up to kick the game-winning field goal for Stanford Saturday night.

''He's got that cool Hawaiian breeze going through his veins,'' Cardinal coach Davis Shaw said about the senior from Honolulu.

Toner's 39-yard field goal came with just a second left on the clock, and Stanford overcame Oregon State's late rally for a 31-28 victory that snapped a three-game losing streak.

The Beavers tied the game at 28 on Artavis Pierce's 1-yard touchdown run with 1:55 left in the game. But Connor Wedington returned the kickoff 43 yards and Davis Mills passed for a first down and ran for another on a final drive that ended with Toner's field goal.

Mills, starting in place of injured quarterback K.J. Costello, threw for 245 yards and three touchdowns for the Cardinal (2-3, 1-2 Pac-12), who extended their winning streak over the Beavers to 10 games. Costello sat out of the game after injuring his thumb in Stanford's loss to No. 13 Oregon last Saturday.

''It was huge,'' Shaw said about the win. ''First and foremost because it was a conference win. Tonight was the great team win that you're looking for.''

The game, which was delayed for 15 minutes because of lightning in the area, was the Pac-12 opener for the Beavers (1-3, 0-1). Oregon State had a bye last weekend after a 45-7 victory over lower-tier Cal Poly two weeks ago.

Jake Luton threw for 337 yards and a touchdown for the Beavers. Isaiah Hodgins had 10 catches for 162 yards and a TD. Hodgins went into the game ranked eighth nationally with an average of 115.7 receiving yards a game.

The Cardinal led 28-14 in the fourth quarter, but B.J. Baylor's 1-yard touchdown run closed the gap with 7:01 left and gave the Beavers momentum.

But in the end the rally fell short.

''It's real tough,'' said Pierce, who finished with 141 yards rushing. ''I feel like it's part of us growing as a team, learning how to win those close games. It's going to involve some growing pains like this. But I feel like will pay off in the end. We just got to keep fighting, stay together and put together a full game instead of one half.''

Stanford's opening drive ended when Toner missed a 53-yard field goal attempt. Oregon State's ensuing drive ended with Jordan Choukair's missed 50-yard try. The Cardinal took over and capped its drive with Mills' 22-yard touchdown pass to Michael Wilson.

Choukair's 33-yard field goal attempt was blocked by Stanford midway through the second quarter.

Mills found Colby Parkinson with a 2-yard touchdown pass late in the half to take a 14-0 lead. The 6-foot-7 Parkinson was critical to Stanford's victory over Oregon State last year with four touchdown receptions. In total, Parkinson caught six passes for 166 yards in the 48-17 win in Palo Alto.

The Beavers got to the Stanford 25 before the break, but Luton was sacked twice, once for 15 yards and again for 5 yards, before time ran out.

Mills connected with Brysen Tremayne on a 3-yard touchdown to extend the lead midway through the third quarter before Luton's 11-yard scoring pass to Hodgins, who barely got a hand on the ball while swarmed by three defenders.

Pierce made it interesting with a 43-yard touchdown run for Oregon State with 12:23 left in the game, closing within 21-14.

Stanford appeared to get a 46-yard field goal from Toner, but the Beavers were penalized on the play, negating the kick and giving the Cardinal a first down. A roughing the passer foul on Oregon State gave Stanford another first down and Parkinson found a leaping Mills with an 8-yard scoring pass.

''I was very excited and very nervous,'' Parkinson said about the play.

THE TAKEAWAY

Stanford: Mills also started for the Cardinal in a loss to USC earlier this season. ... Costello hurt the thumb on his throwing hand when he brought his hand down after a pass and struck the helmet of an Oregon player in the team's 21-6 loss to the Ducks.

Oregon State: The Beavers honored former coach Dennis Erickson, who was inducted into the College Football Hall of Fame this year. He'll be formally enshrined in December. ... Jermar Jefferson, last season's Pac-12 Freshman of the Year, returned after he missed the game against Cal Poly with an ankle injury. But Jefferson ran for just 17 yards on four carries against the Cardinal and played only sparingly in the second half. ... Oregon State did not turn the ball over.

DELAY: The game was originally scheduled to start at 4:10 p.m. local time, but lightning struck nearby during team warmups and the stands were cleared. The game did not start until 4:25 p.m.

QUOTABLE: ''What it really showed was our grit and true character as a team. We're always gonna be able to fight back, throw the last punch and be in a place to win. We're excited about going forward,'' Parkinson said.

UP NEXT

Stanford hosts Washington on Saturday.

Oregon State visits UCLA next Saturday night.

---

More AP college football: https://apnews.com/Collegefootball and https://twitter.com/AP-Top25

Copyright 2019 by STATS LLC and Associated Press. Any commercial use or distribution without the express written consent of STATS LLC and Associated Press is strictly prohibited.