The Tigers (4-1, 2-0 Southeastern Conference) had struggled to move the ball against South Carolina's defense. Trotter had thrown two interceptions and was sacked four times by the Gamecocks (4-1, 2-1). But down 13-9, Barrett led Auburn on a 12-play, 57-yard drive that ended with a pass to wide open Lutzenkirchen in front of the goal line.
The junior fumbled the ball into the end zone, then recovered it just before sliding out of bounds to put Auburn ahead.
South Carolina advanced to Auburn's 29 on its final possession before time expired, though Gamecocks coach Steve Spurrier argued that clock should have stopped with 1 second left after a completed pass for a first down.
Michael Dyer ran for 141 yards on a career-high 41 carries and had a 1-yard TD for Auburn, which has won its past 11 SEC games.
It looked like South Carolina's defense would be enough to bail it out of trouble as quarterback Stephen Garcia again had problems putting up points against an Auburn defense that was ranked dead last in the SEC.
Instead, the Tigers D rose and held the Gamecocks to 54 yards and one first down in the final period. And Trotter and the Tigers found their groove just in time. They converted four third downs in the go-ahead drive, including the touchdown to Lutzenkirchen.
Auburn also did a good job on Marcus Lattimore, who came in as the SEC's leading rusher. He finished with 69 yards on 17 carries. Still, when Lattimore broke through for a 15-yard TD run midway through the third quarter, it appeared it might hold up the way South Carolina's defense was playing.
Melvin Ingram had 3 1/2 sacks and one of four South Carolina interceptions.
Trotter was 12 of 23 for 112 yards with two interceptions.
This one looked like a contest of who'd crack first: Auburn's last-in-the-SEC defense or South Carolina's can't-move-the-ball-too-well offensive attack that has struggled to score the past two weeks.
In the first half, it was the Tigers' D that came up bigger than it had this season. They held Lattimore to 36 yards on nine carries and the Gamecocks managed only four first downs on nine first-half possessions.
Garcia, a lightning rod for Gamecock criticism for his inconsistency, was at it again early on. An interception by Demetruce McNeal - Garcia's eighth of the season - ended one promising drive. When Garcia was short on a sideline play to Nick Jones, Spurrier stomped around in frustration.
Usually, it's Lattimore who bails the Gamecocks out but even he didn't look like himself. He fumbled on one drive and could not fight his way through Auburn's charged up defense.
Not that the Tigers had much success with South Carolina's defense, led by Ingram and safety Antonio Allen. Ingram had two of the Gamecocks three first-half sacks and picked off Auburn's chance to extend a 9-6 lead right before halftime.
The Tigers' reliable kicker Cody Parkey was lined up for a 32-yard field goal try with 1:06 left when holder Ryan White took the snap, rolled right and threw toward Lutzenkirchen near the goal line. But defensive end Ingram had dropped back in coverage to end the threat.
Alshon Jeffery, South Carolina's all-SEC receiver, had the one offensive bright spot the first 30 minutes with a 50-yard touchdown catch as he outmuscled defender T'Sharvan Bell for the ball. But that was just Jeffery's second TD grab of the year.
Dyer answered with his touchdown run to put Auburn up 9-6.
Late TD gives Auburn upset win
Gamecock Anthem Top Stories
Rising Louisiana DB Hits Double-Digit OffersCEDAR HILL, Texas -- Israel Mukuamu has hit double-digit offers and is one of the fastest-rising prospects in Louisiana. Scout caught up with him the UnderArmour Dallas camp.
Scout Football6:05 PM
The Opening Atlanta: Top SurprisesBUFORD, Ga. -- Scout looks at head-turning performances from Nike's The Opening Atlanta that caught our staff by surprise.
Scout Football4:04 PM
Jones plans to trim list to sevenWare County, Georgia outside linebacker Ernest Jones has quietly received offers from P5 schools around the South. Following some spring visits, look for Jones to trim those list…
Offer Alert: Richard JibunorFresh off an MVP performance at The Opening Atlanta, Richard Jibunor is starting to reap the benefits. Notre Dame offered the three-star outside linebacker Tuesday. Jibunor is…
WVU's Belk: Physical Practice Part Of CultureMORGANTOWN, W.Va. - Doug Belk revealed a bit of a surprise in comparing West Virginia's program to that of Alabama.