DETROIT (AP) -- Jordy Mercer's two-run homer in the bottom of the ninth gave the Detroit Tigers a 10-8 victory over Kansas City Royals on Thursday night.
Travis Demeritte led off the ninth with his third walk of the game and moved to second on a sacrifice bunt by Jake Rogers.
Mercer then hit a 2-1 fastball from Richard Lovelady (0-2) into the right-field stands for his sixth homer of the season and the eighth of a game in which both starters struggled.
Joe Jimenez (3-6) got the win with a scoreless ninth inning.
Tigers starter Matt Boyd gave up five runs on six hits and three walks in a season-worst 2 2/3 innings. Boyd entered the game fourth in the American League with 187 strikeouts, but only had one against the Royals.
Hector Lopez, making his first start since May 25, only got four outs. He allowed five runs on two hits, three walks and a hit batter.
The Royals took a 2-0 lead in the first. Whit Merrifield led off the game with a double and scored on Hunter Dozier's one-out homer to right.
Detroit, though, scored five runs on two hits in the second.
After a single and an error, Harold Castro's three-run homer gave the Tigers the lead.
Lopez walked the next two hitters and, after a groundout, hit JaCoby Jones to load the bases. He then walked Niko Goodrum on four pitches to force in Detroit's fourth run of the inning before being replaced by Kevin McCarthy.
McCarthy walked Miguel Cabrera to make it 5-2 before getting out of the inning.
Dozier led off the third with his second homer of the game, and after Jorge Soler walked, Cheslor Cuthbert hit his eighth homer over the Royals bullpen in left-center field.
Boyd retired the next two batters but walked Nick Dini, bringing Matt Hall in from the bullpen.
Kyle Zimmer replaced McCarty to start the third and walked the first three batters he faced. Mercer struck out, but Victor Reyes bounced into a run-scoring force at second to give the Tigers a 6-5 lead.
Cabrera led off the fourth with his 473rd career homer to make it 7-5, but Gordon hit a three-run homer over the scoreboard in right-center to put the Royals ahead 8-7 in the sixth.
Demeritte hit his first major league homer to tie it in the seventh.
GORDON'S HOME AWAY FROM HOME
Gordon's sixth-inning homer was his 15th at Comerica Park, the most by any active visiting player. He is tied with Joe Crede for fifth since the stadium opened in 2000. David Ortiz is the leader with 23 in 55 games.
Jones left the game after being hit on the left wrist in the second inning. X-rays were negative.
Dini, making his major league debut, singled to left in the sixth inning. The catcher is the 10th Royal to play his first game in the majors in 2019.
STREAK FINALLY ENDS
Hall pitched a perfect fourth inning, ending a streak of 43 straight innings where Tigers pitchers had allowed at least one baserunner.
The teams play the second of four games on Friday evening, with Kansas City's Brad Keller (7-11, 3.95) facing a Tigers pitcher who has not been announced.