LOUISVILLE, Ky. -- Edgar Sosa is finally out of Rick Pitino's doghouse.
The much-maligned Louisville point guard hit a 30-footer with 2.8 seconds remaining to give the 18th-ranked Cardinals a 74-71 victory over archrival Kentucky on Sunday.
Sosa finished with 18 points, Terrence Williams had 19 points and eight rebounds and Jerry Smith scored 11 points for Louisville (9-3), which escaped a major meltdown in the final seconds to beat the Wildcats at Freedom Hall for the first time since 2002.
Jodie Meeks led Kentucky (11-4) with 28 points and Patrick Patterson had 22 points and 15 rebounds.
The Wildcats put together a brilliant rally to tie the game at 71 on two free throws by Meeks with 23 seconds left.
Sosa, whose erratic play led Pitino to bench him earlier in the season, held the ball until 6 seconds remained, took two dribbles and hit the shot from well above the head of the key over Michael Porter.
Porter's desperation heave from halfcourt missed as time expired.
Sosa's heroics hardly seemed necessary after the junior gave Louisville a 71-64 lead with two free throws with 51 seconds left.
Yet Meeks was fouled while attempting a 3-pointer. He made all three free throws to cut the deficit to 71-67 before two mental gaffes by Louisville's Earl Clark somehow helped the Wildcats tie the game.
Clark threw an inbounds pass right to Patterson, who hit Meeks for a layup. Clark somehow threw it away again moments later. He tried to hit Sosa running deep, but the pass sailed too long. The Wildcats tracked it down and got it to Meeks, who drove the lane, was fouled and hit two free throws to tie it.
The Cardinals inbounded to Sosa, who calmly took his time before knocking down the biggest shot of his career and capping the comeback performance he desperately needed.
Sosa seemed destined for stardom after a breakout freshman season that he capped with a 31-point performance in a loss to Texas A&M in the second round of the NCAA tournament.
Yet he's spent most of the last two seasons trying to duplicate that performance. Chastised by Pitino for being too emotional, Sosa played all of six minutes in a win over UAB last weekend and was sloppy in a loss to UNLV on New Year's Eve.
Pitino said Sosa briefly considered transferring before the coach convinced him to stay.
It worked out brilliantly, and just in time to salvage Louisville's disappointing nonconference schedule that included losses to Western Kentucky, Minnesota and the Runnin' Rebels.
Kentucky had its six-game winning streak snapped thanks to a familiar culprit: turnovers. The Wildcats, who were averaging 18.2 turnovers a game, gave it away 21 times, including six by Meeks.
Still, the Wildcats had nearly enough to pull off the miracle.
Kentucky trailed by as many as nine points before finally taking its first lead at 43-42 on a putback by Patterson less than 3 minutes into the second half.
The lead lasted all of three seconds.
Kentucky coach Billy Gillispie received a technical foul immediately after the basket, and the Cardinals responded by reeling off 12 straight points, including a three-point play by Sosa that made it 54-43. Williams hit a 3-pointer moments later to push it to 57-45.