NASHVILLE, Tenn. (AP)Spencer Rattler threw three touchdown passes and South Carolina became bowl-eligible with its sixth win of the season, a 38-27 victory over Vanderbilt on Saturday night.

Rattler threw a 29-yard TD pass to Xavier Legette, a 19-yard TD to Josh Vann and a 17-yard TD to Antwane Wells.

The Gamecocks (6-3, 3-3 Southeastern Conference) won their 14th straight game over the Commodores (3-6, 0-5).

South Carolina built a commanding 31-14 halftime lead and handed Vanderbilt its fifth straight loss.

The Commodores suffered their 26th consecutive SEC defeat despite a career-high 167 rushing yards from senior running back Ray Davis, a Temple transfer.

South Carolina scored 10 points off turnovers in the first quarter.

Darius Rush intercepted an underthrown pass by AJ Swann at the Gamecocks 30-yard line, setting up the game’s first touchdown.

Five plays later, Legette got behind the coverage in the middle of the end zone for a 29-yard scoring strike from Rattler to give South Carolina a 7-0 lead.

The teams traded long TD passes before Swann fumbled during a sack at the Commodores 17, setting up Mitch Jeter’s 31-yard field goal which extended the Gamecocks’ lead to 17-7 with 21 seconds left in the first quarter.

THE TAKEAWAY

South Carolina: The Gamecocks’ offense rambled for 492 yards and never trailed. South Carolina faces a difficult finish with games against Florida, No. 2 Tennessee and No. 5 Clemson.

Vanderbilt: Defense continues to be a problem for the Commodores, who have allowed 38 or more points in four of their last five games. Three tough games remain for Vanderbilt: Kentucky, Florida and Tennessee.

TEMPERS FLARE

Gamecocks cornerback Cam Smith and Commodores wide receiver Will Sheppard were flagged with personal fouls after getting into a shoving match with 37 seconds left in the first half. Players from both teams surrounded Smith and Sheppard during the scuffle.

The teams appeared to be yelling at each other from close range as they jogged to their locker rooms for halftime, but nothing escalated beyond that.

UP NEXT

South Carolina visits Florida on Saturday.

Vanderbilt visits Kentucky in its final road game of the season on Saturday.

More AP college football: https://apnews.com/hub/college-football and https://twitter.com/ap-top25. Sign up for the AP’s college football newsletter: https://tinyurl.com/mrxhe6f2