Finally stoking up its offensive fires after a chilly season for that unit and taking advantage of five Cal turnovers, Stanford won the 117th Big Game.

Despite losing standout wide receiver Ty Montgomery in the first quarter, the Cardinal retained the Axe by carving out a 38-17 win Saturday at Memorial Stadium, their fifth straight win in the series.

Stanford (6-5, 4-4 Pac-12), which finishes the regular season Friday at No. 11 UCLA, became bowl eligible with its sixth win, while denying the Bears (5-6, 3-6) their own chance at a bowl berth. Cal finishes next week against BYU.

All five of Stanford’s touchdowns came on the ground. Tailback Remound Wright scored four times, twice as many as he had scored in the previous 10 games, and quarterback Kevin Hogan one.

Montgomery sustained a sprained shoulder when he was tackled on Stanford’s second series. Last year he scored five touchdowns in a 63-13 rout of the Bears.

Stanford had just nine takeaways going into the game, but had three interceptions and a fumble recovery. The Cardinal have outscored the Bears 122-33 in the last three Big Games.

Hogan completed 15 of 20 passes for 214 yards, with one interception, before giving way to Evan Crower in the fourth quarter. He also rushed seven times for 46 yards.

Jared Goff tied the Cal single-season record of 31 touchdown passes, set by Pat Barnes in 1996, with a 10-yard pass to Stephen Anderson in the second quarter.

Cal’s only other touchdown came on Daniel Lasco’s 12-yard run with 2:40 left. Lasco had 103 yards on 18 carries.

Wright’s third touchdown, on a 2-yard run, gave Stanford a commanding 31-7 lead in the third quarter.

Cal committed its fourth turnover on its next series. Backup quarterback Luke Rubenzer tried to hit Trevor Davis in double coverage, and safety Jordan Richards picked it off.

The Bears got the ball back, but in a bizarre sequence, they scored three apparent touchdowns only to have all three overturned by officials’ replay reviews. Two rushing touchdowns by Rubenzer and an apparent 16-yard TD pass from Jared Goff to Kenny Lawler were erased. Finally, James Langford kicked a 38-yard field goal, making it 31-10.

In the first half, the Bears were undone by three turnovers, a fumble by Daniel Lasco and two interceptions off Goff. Stanford mounted a 24-7 lead with three rushing touchdowns but lost Montgomery to an injury in the first quarter.

On Stanford’s first possession, Remound Wright ran for a 1-yard touchdown shortly after breaking off a 30-yard run.

On the Cardinal’s first play from scrimmage, Hogan hit Devon Cajuste for 23 yards, and Cal safety Michael Lowe drew a targeting penalty and an ejection.

A 24-yard field goal by Jordan Williamson extended the lead to 10-0.

The Bears mounted a long drive behind Goff’s passing and Lasco’s running, but Lasco fumbled near the goal line as he was hit by Blake Martinez. The ball bounced into the endzone where A.J. Tarpley recovered it for Stanford and brought it out to the 4.

A leaping catch by Lawlor for 28 yards set up Goff’s TD pass to Anderson.

Wright pushed Stanford’s lead to 17-7 on a 5-yard touchdown run. He was originally called down short of the goal line, but the call was reversed on a replay review.

A 30-yard kickoff return by Kelsey Young kick-started the drive that led to the touchdown. Hogan completed two passes to Cajuste for 30 yards on the drive, and an 18-yard screen pass to Young put the ball on the 5 to set up the touchdown.

A Goff pass that was tipped by linebacker James Vaughters was intercepted by Blake Martinez. Goff had just gained 11 yards on a keeper when he threw the pick.

Stanford soon turned the ball back to the Bears. Hogan badly overthrew Rector on a deep pattern, and the pass was intercepted by Darius White.

A third interception soon followed. Martinez picked off another Goff pass, this one tipped by Peter Kalambayi, giving the Cardinal the ball at the Cal 12. From the 5, Hogan scored to make it 24-7 with 1:22 left in the half.

In the final minute of the game, freshman Terrence Alexander returned an interception off Rebenzer 46 yards to the Cal 6 in the final minute. That’s where the game ended.