SAN DIEGO -- After two straight humbling losses, Utah was badly in need of regaining its swagger.
The Utes finally found it, even if it took most of the game.
Greg Bird's blocked punt in the fourth quarter set up the go-ahead score as Utah (No. 23 BCS, No. 25 AP) rebounded for a 38-34 win over San Diego State on Saturday night.
Up until Bird's clutch play, it appeared Utah might lose a third consecutive game for the first time in five seasons. But after trailing nearly the entire game, the Utes pulled it out.
Utah (9-2, 6-1 Mountain West Conference) broke a two-game losing streak in which it was outscored 75-10. After a 47-7 rout at the home against then-No. 3 TCU, Notre Dame then handed Utah a 28-3 loss last week.
"A lot of things smiled on us," said quarterback Jordan Wynn, who had a career day. "Those two weeks were pretty bad and we needed a win desperately."
The Utes' defense, which was torched in the first half, came back in the second to record two late interceptions.
"We were opportunistic when we needed to be," Utah coach Kyle Whittingham said. "The first half was rough, particularly with our defense. We didn't make any plays. Finally, in the second half, we started making plays in the (secondary)."
The Utes trailed 34-31 in the fourth quarter when Bird blocked Brian Stahovic's punt at the 10-yard line. Christian Cox recovered and ran to the 3-yard line. Eddie Wide scored from the 1 three plays later to give Utah its first lead of the game.
Wynn led a revived offense that had been held to just one touchdown in the previous nine quarters coming in. The sophomore threw for a career-high 362 yards, completing 21 of 33 passes.
"We just needed this win to get our swagger back," said defensive back Brandon Burton, who led the Utes with seven tackles.
Ryan Lindley completed 36 of 54 passes for a career-high 528 yards and four touchdowns, but San Diego State (7-4, 4-3) could not hang on for its second win over a Top 25 team this season.
"I think we showed you how you don't beat a good football team," Aztecs coach Brady Hoke said. "We turned the ball over and give up big plays on defense."
The teams combined for 1,087 yards of offense in a game played for much of the night in a steady drizzle.
San Diego State twice had 17-point leads in the first half as Lindley shredded the Utes' defense. Lindley was 24 of 34 for 321 yards in the first half and had a 27-24 halftime lead.
But the Aztecs managed just one touchdown in the second half and Lindley was intercepted twice in the final 6:04, the second on a throw into the end zone with 1:22 remaining.
"I made a couple of bad decisions and I wasn't able to get the ball down the field," Lindley said. "We just have to make good decisions out there, especially at the end of the game. It's crucial."
The win gave the Utes their fourth consecutive nine-win season.
San Diego State's four losses have come by a combined 15 points, including last week's 40-35 loss at TCU. The Aztecs, who earlier this season broke a 25-game losing streak against Top 25 teams, were trying to record two wins over ranked teams in the same season for the first time in school history.
Utah managed to pull out the win by scoring twice in the fourth quarter.
The first TD came on Matt Asiata's 1-yard run less than two minutes in. Utah gambled on fourth and 1 from the 3-yard line when Asiata took the ball into the end zone. But the replay official overruled the call on the field and Asiata was ruled down at the 1.
Asiata was stopped on two straight carries before he finally scored.
San Diego State was pinned deep in its own territory on its next possession, when Stahovic dropped the snap on fourth down. He picked up the ball, but Bird got a hand on the punt and put Utah in position for Wide's go-ahead score.
"We needed a couple of breaks to go our way the last couple of weeks," Cox said. "We just had a case of back luck and bad execution."
Lindley's last touchdown came early in the third quarter on a 90-yard pass to Vincent Brown for a 34-24 lead.
Brown finished with 8 catches for 184 yards and two touchdowns. DeMarco Sampson had 12 receptions for 154 yards for San Diego State. Both receivers went over 1,000 yards receiving for the season.
Utah trailed 27-10 in the second quarter but scored twice in the final 4:22 to cut the halftime lead to 27-24, including Wynn's jump ball pass into the end zone that went for a 47-yard touchdown when the ball was tipped into Kendrick Moeai's hands with no time left.
The Aztecs had scoring drives of 74, 98 79 and 86 yards in the first half.
Wynn, who was 10 of 15 for 262 yards in the half, threw a 57-yard touchdown pass to Luke Matthews early in the second quarter for the Utes' first TD in 10 quarters.