BERKELEY, Calif. (AP) For one of the few times in his coaching career, California's Sonny Dykes chose the conservative approach.
At the end of a frantic fourth quarter that featured five lead changes, Dykes ignored pleas from offensive coordinator Tony Franklin and chose to send out his kicker rather than trying to move the Golden Bears offense into better field position.
Matt Anderson made the decision pay in a dramatic way.
Jared Goff threw five touchdown passes and Anderson kicked a 26-yard field goal as time expired to cap an improbable comeback and lift California to a 48-46 win over Arizona State on Saturday night.
''Tony really wanted to run a couple more plays on offense but we had the ball right in the middle of the field,'' Dykes said. ''Because (the Sun Devils) blitz so much I didn't want to risk the quarterback getting sacked or holding the ball or somebody fumbling. Give Matt Anderson credit, he nailed it.''
California (7-5, 4-5 Pac-12) trailed by 21 points midway through the second quarter but outscored Arizona State 38-19 over the final two quarters.
Goff completed 30 of 51 passes for a school-record 542 yards in what may be his final game at Memorial Stadium. The Golden Bears' record-setting quarterback - who called the win over the Sun Devils the most memorable moment of his career - is projected as a first-round pick in the 2016 NFL draft should he forgo his senior year.
''To be down by that much and then to come back and win it on a last-second field goal like that, it doesn't really get much better than that,'' Goff said. ''This will be the one I remember for the rest of my life, for sure.''
It's the first time the Bears have won more than six games since 2011.
Mike Bercovici threw four touchdown passes and Zane Gonzalez set a school record with six field goals - four in the second half - for Arizona State (6-6, 4-5).
Goff shook off a rough start to lead Cal's comeback. He completed three passes for 44 yards and scrambled out of a potential sack on the game-winning drive.
Anderson, who earlier kicked a 39-yard field goal, nailed the game-winning kick after the Sun Devils called a timeout to try to ice him.
After Anderson's kick split the uprights, California's players raced out from the sidelines and mobbed the young kicker near midfield.
''I didn't even really see the kick go through,'' Anderson said. ''I was swarmed.''
It's just the second win in the past seven games for the Bears, who are bowl eligible for the first time in three seasons under Dykes.
The Bears were on the verge of getting blown out before Goff led the comeback.
Arizona State moved the ball at will in the first half and caught a break when California's Kanawai Noa muffed a fair catch attempt near his own goal line late in the first quarter.
Three plays later Bercovici found wide receiver Devin Lucien on a crossing pattern for the first of three touchdowns by the Sun Devils' duo.
Bercovici and Lucien also connected on scores of 3 and 36 yards, and Zane Gonzalez added two field goals to push Arizona State's lead to 27-10 at the half.
Lucien finished with eight catches for 200 yards.
Goff got the Bears going with a 52-yard touchdown to Bryce Treggs just before halftime. He later threw a 16-yard touchdown to Chad Hansen in the third quarter and a 9-yarder to Maurice Harris for a 9-yarder to help pull Cal within 33-31.
Goff - who also broke his own single-season passing record - added two more touchdown passes in the fourth quarter.
''We were killing ourselves early,'' Goff said. ''We knew that if we do what we're supposed to do that they wouldn't be able to stop us.''