AUBURN, Ala. -- Nick Marshall ran for three touchdowns and passed for a score and No. 5 Auburn beat South Carolina 42-35 on Saturday night, surviving a scare from the Gamecocks after Steve Spurrier made a succession of gambles that paid off.

The Tigers (6-1, 3-1 Southeastern Conference) finally stopped the onslaught of Spurrier, Dylan Thompson and fourth-down magic late in the game. Auburn burned off four-plus minutes from the clock after the first unsuccessful gamble before the Gamecocks (4-4, 2-4) made a stop at midfield for one more shot.

Thompson, who threw five touchdown passes and helped convert five straight fourth-down tries, took over at his own 15 with no timeouts and 1:08 left. Jonathan Jones made his second interception in the end zone of the fourth quarter on Thompson's last-play heave to preserve the Tigers' SEC and national title hopes.

The Gamecocks, 18-point underdogs, converted an onside kick and four fourth-down plays in their own territory.

Spurrier finally busted on his last gamble. Thompson threw an incompletion on fourth and 14 from Auburn's 19 that gave the Tigers the ball back with 5:28 left.

The Gamecocks got another chance, and moved into Auburn territory with a completion and personal foul against Jonathon Mincy. Then Thompson threw one final pass into a crowd of players from both teams, and Jones came down with it.

Spurrier said he would have gone for two points and the victory if the Gamecocks had scored.

Thompson also had a pick in the end zone early in the fourth when he was drilled by Gabe Wright as he threw.

Auburn tied Florida State for the longest active streak with 14 straight home wins. South Carolina has lost three consecutive SEC games for the first time since the end of the 2009 season.

Marshall ran for 89 yards and completed 12 of 14 passes for 139 yards. He scored on a 37-yard sprint and on runs of 4 and 9 yards.

Cameron Artis-Payne gained 167 yards on 25 carries as Auburn's punishing running game countered South Carolina's prolific passing. Receiver Ricardo Louis ran for 102 yards and raced to a 75-yard touchdown midway through the third quarter.

Thompson was 29-of-51 passing for 402 yards but was also intercepted three times beyond or near the goal line. Pharoh Cooper caught two of his touchdown throws and had 127 yards on seven catches.

It was quite a duel between Spurrier and Auburn's Gus Malzahn, both innovative offensive minds who seemed engaged in a chess match of differing styles. Both had their quarterbacks catch passes for first downs, and both stuck to what they do best.

Auburn racked up 551 yards, 395 on the ground. South Carolina had 416 of its 535 yards through the air.

The difference: Auburn scored four touchdowns on trips inside South Carolina's 20-yard line. The Gamecocks were 2 of 5 with the three picks keeping them out of the end zone.