COLUMBIA, S.C.— Kyle Trask threw for a career-high four touchdowns, three in the fourth quarter, to help No. 9 Florida bounce back from its loss at LSU to outlast South Carolina 38-27 on Saturday.

The Gators (7-1, 4-1 Southeastern Conference) slogged through a soggy field from Tropical Storm Nestor for much of the game. But they eventually came to life and rallied past a South Carolina (3-4, 2-3) team looking to take down a Top 10 opponent for the second straight week after its 20-17 double-overtime win at Georgia.

Instead, it was Florida, off its 42-28 defeat at LSU, that kept making plays on the way to its best start since 2015.

After Trask's interception deep in Florida territory led to Tavien Feaster's 21-yard TD run to put the Gamecocks up 17-10, Dameon Pierce answered right back with a 75-yard scoring run on Florida's next snap to tie it.

In the final period, down 20-17, Trask faced fourth-and-3 on South Carolina's 34 before scrambling from pressure to pick up the first down with a 9-yard pass to Kyle Pitts. Trask followed with the go-ahead 25-yard touchdown throw to Lamical Perine.

Florida's defense came through down the stretch, too, after the Gators took the lead. Defensive end Zachary Carter sacked Ryan Hilinski, who fumbled as nose tackle Kyree Campbell recovered.

Trask finished the series with a 5-yard TD pass to Pitts before a final scoring pass of 5 yards to Trevon Grimes.

Trask completed 21 of 33 passes for 195 yards.

South Carolina, still buoyed by its win over Georgia, looked strong well into the second half and seemed poised once more shuffle the SEC East race with an upset.

But like a year ago, when Florida rallied from 31-14 down to defeat the Gamecocks 35-31, South Carolina could not hold.

Hilinski, who sprained his knee in the Georgia win, was not sharp most of the game. The freshman completed 17 of 35 throws for 170 yards.

Feaster, the Clemson graduate transfer, ran for 175 yards for South Carolina, which was outscored 21-7 in the final period.

Things got so frustrating on the Gamecocks sidelines that coach Will Muschamp picked up an unsportsmanlike conduct penalty in the closing minutes.

THE TAKEAWAY

Florida: The Gators' fourth-quarter escape gives them time to recover from injuries and recoup from a two-month stretch of football. Florida gets next week off before starting a run of three straight SEC East games. The stretch begins with Georgia on Nov. 2, then continues with Vanderbilt and division leader Missouri.

South Carolina: The Gamecocks' defense gave the team a chance at another stunner. But inconsistency on offense doomed South Carolina to its fourth loss to Florida in the past five years.

INJURED GATORS

Florida played without two key defenders in end Jabari Zuniga and linebacker Jonathan Greenard -- both have ankle injuries. Greenard entered the game leading the Gators with four sacks. Zuniga was second with three.

UP NEXT

Florida is off next week before facing No. 10 Georgia in its annual rivalry game in Jacksonville, Florida, on Nov. 2.

South Carolina heads to Tennessee on Saturday.