FORT WORTH (CBSDFW.COM) – Andy Dalton and the rest of the TCU seniors got one last win at home– after finding themselves in an unusual position – and kept alive their national title hopes.

Dalton threw for 240 yards and four touchdowns, three to fellow senior Jeremy Kerley, as the third-ranked Horned Frogs rallied from an early two-touchdown deficit and then held on for a 40-35 victory against San Diego State in their home finale Saturday.

READ MORE: Fort Worth Residents Concerned About Plans To Replace Nearly 100-Year-Old Forest Park Pool

It was the 20th consecutive home win for TCU (11-0, 7-0 Mountain West), which clinched at least a share of the conference title. The Frogs, third in the BCS standings, won their 24th consecutive regular-season game, but it’ll be interesting to see how poll voters react to their closest game of the year.

It probably didn’t help TCU either that Utah, which the Horned Frogs beat 47-7 last week in what was supposed to be their toughest test of the season, lost 28-3 at Notre Dame.

San Diego State (7-3, 4-2), riding its first four-game winning streak in 12 years, led 14-0 less than 6 minutes into the game. A 49-yard flea flicker set up Brandon Sullivan’s leaping 1-yard run and Jerome Long recovered a fumble in the end zone after Dalton was sacked.

A week after a 40-point win at then-undefeated Utah strengthened TCU’s hold on the third spot in the BCS standings, the Horned Frogs faced their first two-touchdown deficit in more than two years. They had trailed for only nine minutes, 19 seconds combined in their first 10 games.

Though it took them nearly 21 minutes to finally go ahead against San Diego State, a missed extra point after the second touchdown extending their time behind, the Horned Frogs finally went ahead to stay and withstood a late Aztecs rally.

San Diego State scored three touchdowns in the final 16 minutes of the game, getting within 40-35 when Ryan Lindley threw two TD passes to Vincent Brown (33 and 35 yards) in less than two minutes. But after the final score with 4:50 left, Dalton and the Frogs ran out the clock.

Lindley was 11 for 26 for 262 yards, with two interceptions.

After Dalton took a blindside hit from Rob Andrews in the end zone and fumbled with 9:16 left in the first quarter, TCU scored touchdowns on five of its next six drives before halftime to build a 34-14 lead. The Aztecs didn’t even make a first down in that span.

READ MORE: Cook Children’s Halts Elective Surgeries Due To Staff, Bed Shortages During COVID-19 Surge

Dalton capped its first scoring drive with a 38-yard TD to Kerley, who caught the ball near the 30 and slipped past a defender along the sideline.

Kerley’s 43-yard punt return set up Dalton’s 15-yard TD pass to tight end Logan Brock on the next drive. But Ross Evans’ extra point attempt hit the upright, keeping the Aztecs ahead 14-13.

Freshman tailback Waymon James put the Frogs ahead to stay on a powerful 9-yard run with 6:39 left in the first half, when he dragged defensive back Larry Parker into the end zone.

James ran for 102 yards on 23 carries. Matthew Tucker had 22 carries for 131 yards.

The Frogs were behind Oregon and Auburn entering the game and ahead of Boise State in the BCS standings, the other team from the non-automatic qualifying conference in contention for a Rose Bowl bid if not the BCS title game. The Broncos beat Idaho 52-14 on Friday night.

TCU has a week off before playing its regular season finale Nov. 27 at New Mexico. Boise State has three games left.

The last home game for Dalton and 25 other seniors was also the last game at Amon G. Carter Stadium before the 80-year-old campus facility undergoes a $105 million major modernizing renovation. Work on that begins next week.

This senior class has won 42 games at TCU, matching the record four-year mark of last year’s seniors. Dalton has 40 wins as the starting quarterback, the most among active FBS quarterbacks and the most in school history.

San Diego State had 307 total yards, 128 below their season average but the second-most this season against TCU’s top-ranked defense. Five of the previous six Mountain West opponents had been held under 200 yards, and SMU had a season-high 361 yards against TCU back in September.

MORE NEWS: COVID-19 Vaccines Don't Impact Fertility, But The Virus Does, Doctors Say

(Copyright 2010 by The Associated Press. All Rights Reserved.)