The Tigers protected their share of the American League Central lead by overcoming an early three-run deficit.
Jeff Francoeur's fourth-inning homer gave the Royals a 4-1 lead, but Alex Avila hit a two-run shot in the bottom half of the inning and Austin Jackson then produced his 16th homer of the year to tie the contest.
Kansas City left fielder Alex Gordon preserved the tie in the fifth by reaching over the wall to take a potential home run away from Miguel Cabrera, but the Tigers finally came through with the winning run in the eighth.
Delmon Young reached on a one-out, infield single against Kelvin Herrera (4-3) and gave way to Kelly as a pinch runner. Kelly stole second and took third on a single by Andy Dirks.
That brought up Jhonny Peralta, who hit a grounder to Mike Moustakas at third. Rather than try to get Kelly at the plate, Moustakas attempted to turn a double play. His throw to second baseman Irving Falu was in time to force Dirks, but Dirks took out Falu with his slide to prevent the double play from being completed.
2014: NFL Cheerleaders [PHOTOS]
LeBron James reveals his new Nike shoes