FRESNO, Calif. (AP) -- As soon as the clock ran out on Fresno State's first win over Boise State since 2005, Derek Carr looked for his big brother David to give him a hug.
Derek Carr had been waiting for this moment ever since watching Davis lose a game that launched this lopsided rivalry back in 2001.
Derek Carr threw for 460 yards and four touchdowns and led the game-winning drive that helped Fresno State avoid a fourth-quarter collapse and snap a seven-game losing streak to Boise State with a 41-40 victory on Friday night.
''One of the main reasons I came here was that moment,'' Derek Carr said. ''I remember sitting up in the stands as a little kid and crying because my brother lost a game. It's just a game, but it meant a lot to me. I went straight to him and told him that one was for him.''
Josh Quezada capped a 13-play, 87-yard drive with a 1-yard run with 2:14 remaining that put the Bulldogs (3-0, 1-0 Mountain West) back ahead after they had blown a 15-point lead.
Aaron Baltazar had run for two scores, and Joe Southwick added another as Boise State (2-2, 1-1) scored three touchdowns in less than 9 minutes to turn a 34-19 deficit into a 40-34 lead with just over 7 minutes remaining.
But Carr calmly completed 8 of 11 passes on the ensuing drive in front of a sellout crowd before Quezada ran it in for the go-ahead score.
''They've had our number,'' coach Tim DeRuyter said. ''In a lot of people's minds this game is the measuring stick by where you stand in the conference. To get past that is huge.''
The game was sealed when Jonathan Norton broke up a pass to Kirby Moore on fourth-and-6 near midfield in the final minute, setting off a long-awaited celebration.
''Joe gave me a chance,'' Moore said. ''I've got to come down with that one.''
Josh Harper caught two TD passes, Davonte Adams had another to extend his streak to 11 games, and Quezada scored twice for the Bulldogs.
The Broncos (2-2, 1-1) have dominated the series since upsetting then-No. 8 Fresno State 35-30 in 2001. Boise State had won 11 of 12 meetings coming into this game with the only loss coming in 2005. Most of the games haven't even been close with the Broncos outscoring the Bulldogs by more than 30 a game the past seven years.
''We are tired of always hearing about Boise,'' safety Derron Smith said. ''No disrespect to them. They always have a good team and play hard. We have respect for them. To finally get the W against them is a good feeling.''
Boise State made uncharacteristic mistakes. Southwick threw an interception deep in Fresno State territory to end a drive in the first half, and Jay Ajayi lost a fumble deep in Bulldogs territory after appearing to convert a fourth-and-1 carry.
''You've got to be able to hold onto the ball, you can't throw easy interceptions, we can't make those kinds of mistakes,'' coach Chris Petersen said.
The Broncos didn't go away easily as Dallas Burroughs returned the ensuing kickoff 58 yards to set up Aaron Baltazar's 35-yard touchdown run on the next play.
Boise State held Carr and the Bulldogs on the next drive and Fresno State punted on fourth-and-1 from the Broncos 44. Boise State drove down for another score on a 2-yard run by Baltazar but failed for the second time on a 2-point conversion and trailed 34-32 with 8:28 remaining.
Fresno State then botched the ensuing pooch kick, giving Boise State the ball at the 31. Southwick almost gave the ball back when he appeared to fumble the ball out of the end zone after a long run, but the officials ruled he stepped out of bounds at the 3 just before losing the ball.
Two plays later, Southwick scored on a sneak from the 1, and Boise got the 2-point conversion on a pass from receiver Matt Miller to Jake Hardee.
That is when Carr came through with the biggest drive of his career to win it.
Fresno State got off to a fast start, forcing a punt after the opening kick and then converting three straight third downs to take a 7-0 lead on Carr's 14-yard screen pass to Quezada. That was the Bulldogs' first lead against Boise State since 2008.
That started a back-and-forth, fast-paced opening half that featured eight scores, 567 yards of offense and 97 offensive plays as Fresno State took a 24-19 lead at the break.