This back-and-forth battle for the Governor's Cup wasn't won until the final 2 minutes when Louisville quarterback Justin Burke was driving for a potential game-winning score, only to have a pass tipped by Corey Peters and picked off by Sam Maxwell.
Kentucky (2-0) had to punt the ball back to Louisville, but Burke's last-second Hail Mary was incomplete.
A fumbled kickoff return set up Kentucky's final score, a 12-yard pass from Mike Hartline to a leaping Randall Cobb - his former rival for the starting quarterback job. Prior to that, Louisville (1-1) had taken the lead by forcing three consecutive Wildcats turnovers.
Hartline committed two of those miscues on a fumbled snap and a pass that was intercepted by a diving Johnny Patrick. He completed 20 of 27 passes for 178 yards.
After Louisville was penalized five yards for offsides, Locke took a first quarter kickoff from his own end zone, got one block downfield and sprinted untouched to the end zone. Locke was the first Wildcats player in history to return two 100-yard kickoffs for TDs, having also done it last year against Western Kentucky.
Although he had 191 return yards to go with his 72 rushing and 47 receiving yards, Locke also had a critical fumble of a kickoff in the second half, the first of three consecutive Kentucky drives that ended with turnovers.
Louisville drove deep into Kentucky territory all three times and also on the opening drive of the second half, after Trent Guy returned the kickoff 65 yards. Still, the Cardinals managed just one touchdown on any of those chances - a 5-yard pass from Burke to Cameron Graham.
Guy caught just one pass, but it was by far the longest in Burke's short two-game career as the starter. The quarterback hit him in stride as he sprinted down the sideline for a 66-yard score that gave Louisville its final lead at 27-24.
Burke, who played in high school at Lexington Catholic - just a few miles from Commonwealth Stadium where Saturday's game was played, completed 15 of 28 passes for 245 yards and two TDs.
Both teams sustained long scoring drives in the first quarter, but while Kentucky had to settle for a field goal, Louisville took an early 7-3 lead behind some dynamic running by Victor Anderson, who had 19 carries for 110 yards.
Anderson changed direction and scampered 35 yards on Louisville's first play from scrimmage, then he ended a nine-play drive by running up the middle for a 3-yard score - the Cardinals lone rushing TD of the day.