STANFORD, Calif. - No. 18 Stanford proved it could win an offensive shootout, and quarterback Josh Nunes proved he could lead a fourth-quarter comeback as the Cardinal outlasted Arizona 54-48 in overtime at Stanford Stadium on Saturday afternoon. Stanford (4-1, 2-1 in the Pac-12) overcame a 14-point deficit with 9:03 left in the fourth quarter, and scored the tying touchdown with 45 seconds to go on Nunes' three-yard touchdown run, one play after he completed a 17-yard pass to Zach Ertz on a fourth-and nine play from the 20. In the overtime, Chase Thomas intercepted a tipped Matt Scott pass to end Arizona's possession, and Stepfan Taylor ended the game on a 21-yard touchdown run on the Cardinal's second play of overtime. Scott set single-game school records for passing attempts (69) and completions (45), while piling up 491 passing yards with three touchdowns and the one interception against a Cardinal defense that had been effective in the first four games. Arizona running back Ka'Deem Carey added 132 rushing yards, and Austin Hill had 11 catches for 165 receiving yards. Taylor rushed for 142 yards, and Nunes completed 21 of 34 passes for a career-high 360 yards and two touchdowns. Tight end Levine Toilolo had 141 receiving yards. Arizona, which dropped to 3-3 with its third straight loss, overcame a one-point halftime deficit by taking the second-half kickoff and quickly driving 75 yards for a score that gave the Wildcats a 20-14 lead. Scott completed passes of 14, 15 and 27 yards in the drive, which ended with Stanford taking the lead back by driving 85 yards for a touchdown to make it 21-20 at the 10:51 mark of the third quarter. Tight end Levine Toilolo had receptions of 17 and 47 yards in the drive before Nunes scored from two yards out. The Wildcats went back in front 27-21 on a 75-yard drive that ended with Scott's 12-yard pass to Austin Hill. But Stanford took a 28-27 lead on a 90-yard touchdown drive highlighted by Nunes' perfectly thrown 54-yard completion to Jamal Rashard-Patterson that put the ball a the Arizona 7. The lead lasted only 1:17 as the Wildcats drove 75 yards to go ahead 33-28. They missed a two-point conversion try though. Less than a minute later Kelsey Young scored on a 55-yard touchdown run that put the Cardinal back in front 34-33 with 28 seconds left in the third quarter, but the Cardinal's two-point try also failed. Arizona's 70-yard touchdown drive put the Wildcats back in front 41-34 early in the fourth quarter after Austin Hill caught a two-point conversion pass. The game's first turnover - a Ty Montgomery fumble at the Stanford 45 - resulted in a nine-yard touchdown pass that pushed the Arizona lead to 48-34. A 60-yard Stanford scoring drive got the Cardinal within 48-41 with 6:34 left, and the Cardinal scored gain on a 79-yard drive after getting the ball back with 5:43 left, sending the game in overtime. The offensive explosion started early. Scott threw 37 passes in the second quarter alone and was 26-for-41 for 218 yards in the first half, which ended with the Cardinal holding a 14-13 lead. NOTES: Stanford lost starting cornerback Terrence Brown when he was inadvertently kicked in the chin on Arizona's second offensive play. ... Stanford backup tailback Anthony Wilkerson missed his second straight game Saturday because of a lower leg injury. ... Saturday's game was Arizona's third straight against a ranked opponent, and its next three opponents - Washington, USC and UCLA - are all ranked as of Saturday. ... Stanford had won 16 of its past 17 home games before Saturday's contest, its lone loss in that stretch coming against Oregon last year. ... Arizona played without center Kyle Quinn (ankle) and safety Jared Tevis (ankle). Tevis was second in the Pac-12 in tackles heading into the weekend. ... Arizona's Scott entered Saturday's game ranked fifth in the nation in total offense. ... Entering Saturday, Rich Rodriguez had a 12-4 record in nonconference games and a 6-20 record in conference games since leaving West Virginia following the 2007 season.