FORT COLLINS, Colo. (AP) -- Quarterback Kevin O'Connell ran for three touchdowns, the third coming with 43 seconds left in the game, as San Diego State extended Colorado State's losing streak to 12 games with a 24-20 victory Saturday.
O'Connell had 15 carries for 42 yards and completed 14-of-27 passes for 187 yards for San Diego State (2-3, 1-0 Mountain West Conference).
Trailing 20-17 in the fourth quarter, O'Connell completed a 57-yard pass to Brett Swain to get San Diego State to the Colorado State 23. O'Connell had a 14-yard run to get the Aztecs to the 6 and two plays later dove over the line to put the Aztecs ahead 24-20.
Kyle Bell ran for 76 yards on 19 carries.
O'Connell scored on a 1-yard keeper on a fourth-and-goal play on the first possession of the game to put San Diego State ahead 7-0.
Colorado drove to the San Diego State 24 late in the first quarter, but Aaron Moore intercepted Hanie in the end zone. It was Hanie's eighth interception thrown this year and Moore's second interception of the season.
San Diego State missed a chance to add to its lead early in the second quarter when Colorado State punter Jimmie Kaylor overthrew Jake Galusha on a fourth-and-8 from the Rams' 44. But O'Connell was sacked twice, and San Diego State had to punt.
Colorado State scored 13 points in the third quarter to take a 13-10 lead. Michael Hughes had a 12-yard punt to set up Jason Smith's 39-yard field goal with 11:13 left in the third quarter.
The Rams took advantage of excellent field position to take a 10-7 lead on Hanie's 1-yard sneak. From the San Diego State 43, Bell ran the ball four times to reach the 17 before Hanie dove over for the score with 6:53 left in the third quarter.
San Diego State quickly tied the game at 10 on Garrett Palmer's 33-yard field goal with 4:30 left in the third quarter. The field goal was set up by a 46-yard pass play from Darren Mougey to Vincent Brown.
But two San Diego State possessions later, Darryl Williams recovered Brandon Bornes' fumble at the Aztecs' 20. Colorado State settled for a 20-yard field goal by Smith as time expired in the third quarter, putting the Rams on top 13-10.
San Diego got the lead back when O'Connell ran through several arm tackles on a 16-yard TD run with 13:16 left in the fourth quarter.