Updated

Kentucky coach Mark Stoops saw both sides of his young, rebuilding Wildcats at No. 13 South Carolina on Saturday night.

Stoops was encouraged Kentucky fought back from a 21-0 deficit and got within a touchdown of the Gamecocks. And he was discouraged that when it was time to make the critical play down the stretch, the Wildcats couldn't and lost 35-28.

"We took their best shot, battled back and had an opportunity to make plays in the fourth quarter," Stoops said. "I was proud we were in a position to do that but very frustrated that we couldn't."

Stoops and his team are almost through a grueling stretch of ranked opponents, losing to No. 7 Louisville 27-13 two games ago and No. 19 Florida last week. The stretch ends next Saturday against top-ranked Alabama.

Kentucky offensive coordinator Neal Brown thinks the Wildcats (1-4, 0-2 Southeastern Conference) have something they can build on in what they showed against South Carolina.

"We don't have moral victories in our program. I'm not sitting here happy at all," Brown said. "I'm happy (though) how we competed."

Kentucky didn't have to deal with South Carolina All-American defensive end Jadeveon Clowney, who asked out of the game before kickoff because of bruised ribs that kept him out of practice Thursday.

Gamecocks coach Steve Spurrier said he wasn't sure if the SEC's reigning defensive player of the year would play at Arkansas next week.

If Clowney "wants to play, we will welcome him to come play for the team if he wants," Spurrier said. "But he if doesn't want to play, he doesn't have to play. Simple as that."

Connor Shaw threw for a touchdown and rushed for another and Mike Davis had 106 yards rushing for South Carolina.

Defensive coordinator Lorenzo Ward said he thought Clowney would play during the team's walk-through earlier Saturday and was surprised when he learned he wouldn't be out there.

"He saidd he was hurting, but I thought he was going to play," Ward said. "Love to have JD out there, but we've got to put 11 guys on the field."

The 11 out there gave Spurrier, Ward and a sold-out Williams-Brice Stadium several anxious moments as Kentucky rallied from 21-0 to pull to 27-21 on Jalen Whitlow's 14-yard touchdown pass to Ryan Timmons with 11:50 remaining.

They were still within a touchdown after Whitlow bulled his way to a 1-yard scoring run with four minutes left. But the Gamecocks ran out the clock behind SEC leading rusher Davis and beat Kentucky for the 13th time in the last 14 meetings.

It was South Carolina's 14th straight home victory, the third-longest active streak behind Michigan and Georgia. Gamecocks coach Steve Spurrier improved his career mark to 20-1 against the Wildcats. No other active coach has posted 20 victories against one team.

And this one didn't come easy, although the Gamecocks might be used to the script by now.

Two games ago, South Carolina led Vanderbilt 28-0 before the Commodores closed to 35-25. Last week, the Gamecocks were up 28-10 at UCF when the Knights posted two touchdowns in the fourth quarter and South Carolina needed to field an onside kick with under two minutes left to close out a 28-25 win.

This time, the Gamecocks were up 21-0 on Shaw's 62-yard touchdown pass to Damiere Byrd and two scoring runs by Mike Davis. The Wildcats' comeback took flight after halftime when Demarco Robinson scored on 4-yard pass.

Bruce Ellington fumbled the next kickoff and the Wildcats cashed in on the turnover with Whitlow's pass to Timmons.

The Gamecocks gave themselves some breathing room the next sequence when Shaw scored from 2 yards out and completed a pass to Nick Jones for a two-point play to go up 35-21.

Kentucky, though, wasn't done as Whitlow completed passes of 22 yards to Jordan Aumiller for 22 yards and Javess Blue for 33 yards to the Gamecocks 2. Whitlow tightened things up one last time with his touchdown run with 4:02 to go.

Shamir Jeffery, the younger brother of ex-Gamecocks star Alshon Jeffery, fielded the ensuing onside kick and Davis and Shaw were able to run out the clock.

"It was good the see the offense find their rhythm, move the ball and get into the end zone," Stoops said. "I was proud of that. I felt like if we could have gotten another stop defensively, we would have given ourselves a chance to score at the end."

Not that Clowney's absence made much difference to the Wildcats early on as they struggled to gain yards against the Gamecocks. Kentucky managed only 34 yards in the opening quarter and Shaw made them pay.

South Carolina's senior quarterback, who was expected to miss up to three weeks after landing hard on his shoulder last week at UCF, was healthy and on target from the start.

Shaw completed 17 of 20 passes for 262 yards. He also rushed for 50 yards.

"It's never frustrating when you win," Shaw said. "I'm proud of the guys on offense and how we battled tonight."