The victory makes Oregon State (6-4, 4-3 Pac-12) bowl eligible for the first time since 2013, and snapped an 11-game losing streak against the Cardinal.
"It's been a long time coming, man," Oregon State senior linebacker Andrzej Hughes-Murray said of becoming bowl eligible. "I'm happy for my guys and happy for coach (Jonathan) Smith. And happy for myself, too."
Smith, who was hired in 2018 to coach at his alma mater, inherited a team that was coming off a 1-11 season.
"There's no question this is big," said Smith, who was the starting quarterback during Oregon State's 2000 Fiesta Bowl season. "(Win) number six is big. I'm not going to dance around that. We've got a couple more games that can mean a whole lot."
Nolan completed 19 of 25 passes, including a 67-yard touchdown to Trevon Bradford that increased the lead to 21-0 early in the third quarter.
Injuries have taken a toll on Stanford (3-7, 2-6), which has lost five games in a row for the first time under coach David Shaw.
Freshman Ari Patu struggled to get the Cardinal's passing game going in his first career start, completing 7 of 14 for 51 yards with a touchdown and interception before leaving midway through the third quarter with an undisclosed injury. Stanford used three quarterbacks in the game.
"Better fight from our guys this week," said Shaw, whose team was coming off a 52-7 loss to Utah. "We're not just looking for better, we're trying to win."
Oregon State's defense made strides after giving up a total of 76 points in its previous two games, losses at California and Colorado.
Smith fired defensive coordinator Tim Tibesar on Sunday, handing the reigns to linebackers coach Trent Bray on an interim basis. The Beavers forced three turnovers, including interceptions by safety Jaydon Grant and cornerback Rejzohn Wright. Stanford was limited to 230 total yards.
"Better energy, yeah, 100 percent," Hughes-Murray said. "We talked about earlier this week just letting it rip. Just going out, cutting loose and just playing. That's what we went out there and did."
The Beavers weren't exactly facing an offensive juggernaut. Stanford managed just 168 total yards in the lost to Utah, which was the program's most lopsided defeat since 2003.
Oregon State, which amassed 475 total yards, opened the scoring in the first quarter on Nolan's 4-yard touchdown run, capping a 16-play, 74-yard drive.
Jack Colletto's 2-yard touchdown run on a direct snap with 17 seconds left in the first half gave the Beavers a 14-0 advantage at the break. Stanford managed just 74 total yards in the opening half and its best drive ended on a blocked field goal attempt from 55 yards.
Oregon State increased its lead to 21-0 early in the third quarter when Bradford turned a short pass into a 67-yard touchdown.
Stanford answered with Patu's 8-yard touchdown pass to tight end Benjamin Yurosek on fourth and 2, cutting the lead to 21-7.
B.J. Baylor's 6-yard touchdown run late in the third quarter, and a 5-yard touchdown pass to tight end Teagan Quitoriano early in the third quarter gave Oregon State a 35-7 lead.
Stanford: The Cardinal are guaranteed to have their second losing season since Shaw become head coach in 2011. Stanford was 4-8 in 2019.
Patu became the first true freshman to start at quarterback for Stanford since John Paye in 1983. He had played in just one previous game, attempting two passes against Utah. Tanner McKee, who made six starts this season and had 14 touchdown passes, suffered a leg injury in the Washington game Oct. 30 and is out indefinitely.
Oregon State: Baylor became the first 1,000-yard rusher for Oregon State since Jermar Jefferson in 2018. Baylor ran for 80 yards on 23 carries and scored his 12th rushing touchdown of the season.
The Beavers last bowl appearance was a victory over Boise State in the 2013 Hawaii Bowl.
Stanford: The Cardinal host California next Saturday.
Oregon State: The Beavers host Arizona State next Saturday in their final home game of the season.
More AP college football: https://apnews.com/hub/college-football and https://twitter.com/AP--Top25.
Sign up for the AP's college football newsletter: https://apnews.com/cfbtop25
Oregon State becomes bowl eligible with win vs. Stanford
Oregon State shuts out Stanford in the first half on its way to 35-14 win.