COLUMBIA, S.C. -- Kentucky coach Matthew Mitchell worried things had been too easy for this Wildcats, even as they built the nation's best winning streak at 17 games and rose to No. 5 in the rankings.

It all came crashing down Thursday as No. 18 South Carolina (17-3, 5-2 Southeastern Conference) beat Kentucky 55-50. The Gamecocks used their pressure defense to hold the Wildcats 30 points under their SEC-best scoring average. It was South Carolina's first win over a top-five team since 1998.

Mitchell said he hopes Kentucky (18-2, 6-1) learned by being pushed around the floor that it has to answer a team that plays tough by being tough itself.

"For whatever reason, they just were not interested in answering that physical challenge," Mitchell said.

Kentucky led for most of the second half before the Gamecocks went on a 18-4 run to take a 52-44 lead with 3:34 left. South Carolina hit just three free throws down the stretch, but the defense hung on.

The Wildcats hadn't lost since an 85-51 defeat to then No. 1 Baylor on Nov. 13. But they appeared rattled at the end. Jennifer O'Neil missed a teammate entirely with a pass with Kentucky down three with 17 seconds to go. The Wildcats turned it over again 5 seconds later as Ashley Bruner ended Kentucky's last chance by knocking away an inbound pass with 12.7 seconds left.

"This was the first time we have faced serious adversity," O'Neil said. "Like coach said, we didn't have poise."

Kentucky came into the game as the second-best offense in the SEC at 79 points a game. But the Wildcats ran into the best defense in the SEC. South Carolina allows just 48 points a game and has held every opponent but one under 60 points.

Kentucky went almost nine minutes without a point in the first half, and scored just one bucket in six minutes as South Carolina built its biggest lead of the game at eight points late in the second half. The Wildcats shot 32.8 percent (19 of 58) from the field. A Kentucky team that led the SEC by forcing 10 more turnovers than its opponents, turned the ball over 18 times -- two more than South Carolina.

"The turnovers were critical. But a lot of them could have been prevented if we had tried to match South Carolina's toughness tonight," Mitchell said.

South Carolina scored five more points on the fast break against a Kentucky team that prides itself on getting easy baskets after turning up the pressure.

The Gamecocks shot just 37.7 percent (20 of 53), but that is fine with coach Dawn Staley, especially when the game stays in the 50s.

"It's exhausting to play as hard as we play defensively. It takes the wind out of you. But the crowd put the life back into us and we came up with some big plays," Staley said.

Staley has done a lot in her five seasons at South Carolina, reviving the program and getting the Gamecocks to their first NCAA tournament in nine years last season. But she hadn't knocked off a top five team in 12 tries until Thursday night.

"We kept coming up short against opponents like a Kentucky, like the Stanfords and Tennessees. I'm happy to see their hard work, what they put into it, paid off," Staley said.

Ieasia Walker had 16 points and eight rebounds, while Aleighsa Welch scored 11 points and had seven rebounds and Elem Ibiam added eight points and eight rebounds for South Carolina.

Jennifer O'Neil led Kentucky with 17 points, while DeNesha Stallworth added 12 points and 10 rebounds and A'dia Mathies also has 12 points.

The Gamecocks even overcame their biggest weakness. South Carolina is next-to-last in Division I in free throws, shooting just 54 percent. But they hit 10 of their last 16 foul shots, even though they shot just 48 percent from the foul line in the game (13 of 27).