Salvador Perez hit a three-run home run, Maikel Franco hit a go-ahead homer in the sixth inning and the Kansas City Royals beat the Detroit Tigers 8-7 on Thursday night.

Franco's eighth homer of the season put the Royals ahead in a game between two teams eliminated from postseason play. Adalberto Mondesi had four hits and two RBIs, Perez had two hits and three RBIs, and Jorge Soler plated one.

Miguel Cabrera continued his hot streak with a two-run homer in the fifth to tie the game at 4. He has four home runs and 12 RBIs in the past four games.

Kansas City Royals left fielder Alex Gordon can't catch a foul ball hit by Detroit Tigers' Victor Reyes during the seventh inning of a baseball game Thursday, Sept. 24, 2020, in Kansas City, Mo. (AP PhotoCharlie Riedel)

Kansas City Royals left fielder Alex Gordon can't catch a foul ball hit by Detroit Tigers' Victor Reyes during the seventh inning of a baseball game Thursday, Sept. 24, 2020, in Kansas City, Mo. (AP PhotoCharlie Riedel)

Tigers starter Michael Fulmer was pulled after 2 1/3 innings having given up four runs and seven hits on just 42 pitches. Tyler Alexander (2-3) got the loss, allowing a run and two hits over 2 2/3.

The Royals got to Fulmer in the first with singles by Whit Merrifield and Mondesi, and Perez hit a three-run homer on the ensuing at-bat into the left field bullpen.

Willi Castro hit a two-run home run for Detroit, his sixth of the season, to make it 3-2 in the third. Castro, Cabrera and Harold Castro had RBIs in the eighth off right-hander Josh Staumont, who gave up three runs and got just two outs.

Detroit Tigers right fielder Daz Cameron can't catch an RBI double hit by Kansas City Royals' Jorge Soler during the sixth inning of a baseball game Thursday, Sept. 24, 2020, in Kansas City, Mo. (AP PhotoCharlie Riedel)

Detroit Tigers right fielder Daz Cameron can't catch an RBI double hit by Kansas City Royals' Jorge Soler during the sixth inning of a baseball game Thursday, Sept. 24, 2020, in Kansas City, Mo. (AP PhotoCharlie Riedel)

Royals starter Kris Bubic allowed four runs, eight hits and three walks over 4 2/3 innings, striking out five. Jesse Hahn (1-0) got four outs and his first major league win since 2017, and Jake Newberry completed his first career save.

Soler scored Hunter Dozier on a double in the sixth, and Mondesi had a two-run single to extend the lead to 8-4.

ROYAL RETIREMENT

Detroit Tigers center fielder Victor Reyes (22) and right fielder Daz Cameron (41) try to field an RBI double hit by Kansas City Royals' Jorge Soler during the sixth inning of a baseball game Thursday, Sept. 24, 2020, in Kansas City, Mo. (AP PhotoCharlie Riedel)

Detroit Tigers center fielder Victor Reyes (22) and right fielder Daz Cameron (41) try to field an RBI double hit by Kansas City Royals' Jorge Soler during the sixth inning of a baseball game Thursday, Sept. 24, 2020, in Kansas City, Mo. (AP PhotoCharlie Riedel)

Before the game, Royals OF Alex Gordon announced his retirement following this season. The second overall pick in 2005 will leave the game playing all 13 seasons for the Royals. He has won seven Gold Gloves, second most in franchise history behind Frank White's eight.

ROSTER MOVES

The Royals recalled LHP Richard Lovelady and optioned RHP Scott Blewett.

Detroit Tigers' Miguel Cabrera watches his two-run home run during the fifth inning of a baseball game against the Kansas City Royals, Thursday, Sept. 24, 2020, in Kansas City, Mo. (AP PhotoCharlie Riedel)

Detroit Tigers' Miguel Cabrera watches his two-run home run during the fifth inning of a baseball game against the Kansas City Royals, Thursday, Sept. 24, 2020, in Kansas City, Mo. (AP PhotoCharlie Riedel)

TRAINING ROOM

Tigers 3B Jeimer Candelario left the game (low back tightness) and is day-to-day.

Royals OF Franchy Cordero will be ready to play on Friday after exiting the game with leg cramps.

UP NEXT

Detroit will send RHP Spencer Turnbull (4-3, 3.83) to the hill Friday night as the Royals counter with RHP Brad Keller (4-3, 2.77), who will look to rebound after giving up five runs in five innings on Sunday against Milwaukee.

More AP MLB: https://apnews.com/MLB and https://twitter.com/AP_Sports