Mikie Mahtook hit a two-run homer in the eighth inning, and the Detroit Tigers beat the Kansas City Royals 5-4 on Saturday night in Victor Martinez's final major league game.

With the score tied at 3, Niko Goodrum led off the eighth with his third hit of the game, a single off Jason Hammel (3-14). Mahtook then lined Hammel's 1-0 slider over the left-field fence for his ninth homer.

More Images
Detroit Tigers designated hitter Victor Martinez acknowledges the fans after his single against the Kansas City Royals during the first inning of a baseball game Saturday, Sept. 22, 2018, in Detroit. Martinez, playing in his final game, was removed for a pinch-runner after the single. (AP PhotoCarlos Osorio)

Mikie Mahtook hit a two-run homer in the eighth inning, and the Detroit Tigers beat the Kansas City Royals 5-4 on Saturday night in Victor Martinez's final major league game.

Detroit Tigers designated hitter Victor Martinez holds back tears during an on-field ceremony before the team's baseball game against the Kansas City Royals on Saturday, Sept. 22, 2018, in Detroit. Martinez, playing in his final game, has said he wants his final at-bats to be in front of the home fans. (AP PhotoCarlos Osorio)

Tigers starter Jordan Zimmermann allowed two runs on three hits in seven innings. He walked two and struck out five. Joe Jimenez (5-4) allowed the Royals to tie it in the eighth but earned the win.

Detroit Tigers designated hitter Victor Martinez is presented a chair by Al Avila, executive vice president of baseball operations and general manager, before the Tigers' baseball game against the Kansas City Royals, Saturday, Sept. 22, 2018, in Detroit. Martinez is playing his final game, and said he wants his final at-bats to be in front of the home fans. (AP PhotoCarlos Osorio)

Whit Merrifield drove the game's first pitch to right-center. JaCoby Jones made a diving try but the ball popped out of his glove when he hit the ground, giving Merrifield a triple. Adalberto Mondesi followed with a sacrifice fly.

Kansas City Royals' Brett Phillips is greeted in the dugout after scoring during the eighth inning of the team's baseball game against the Detroit Tigers, Saturday, Sept. 22, 2018, in Detroit. (AP PhotoCarlos Osorio)

Brett Phillips singled off Jimenez with one out in the eighth and scored the tying run on Merrifield's double down the left-field line.

Kansas City Royals' Brett Phillips beats the throw to Detroit Tigers catcher James McCann to score during the eighth inning of a baseball game Saturday, Sept. 22, 2018, in Detroit. (AP PhotoCarlos Osorio)

KOZMA RARITY

Kansas City Royals' Alex Gordon rounds the bases after his solo home run as Detroit Tigers starting pitcher Jordan Zimmermann (27) walks on the mound during the fourth inning of a baseball game Saturday, Sept. 22, 2018, in Detroit. (AP PhotoCarlos Osorio)

Martinez was honored in a pregame ceremony that included a video tribute and gifts for his family presented by the team's other Latin American players, including Miguel Cabrera, who had been away from the team while rehabbing his biceps injury.

Detroit Tigers starting pitcher Jordan Zimmermann throws during the second inning of the team's baseball game against the Kansas City Royals, Saturday, Sept. 22, 2018, in Detroit. (AP PhotoCarlos Osorio)

UP NEXT

Detroit Tigers designated hitter Victor Martinez hugs a family member before a baseball game Saturday, Sept. 22, 2018, in Detroit. Martinez is playing his final game Saturday and said he wants his final at-bats to be in front of the home fans. (AP PhotoCarlos Osorio)

Detroit Tigers designated hitter Victor Martinez hugs a family member before a baseball game Saturday, Sept. 22, 2018, in Detroit. Martinez is playing his final game Saturday and said he wants his final at-bats to be in front of the home fans. (AP PhotoCarlos Osorio)

The 39-year-old Martinez, who made his debut with Cleveland in 2002, hit an infield single in his first at-bat and was immediately removed for pinch-runner Ronny Rodriguez. Fellow Venezuelans Salvador Perez and Alcides Escobar came out of the Royals' dugout to embrace the five-time All-Star as he walked off the field to a standing ovation.

Detroit Tigers designated hitter Victor Martinez acknowledges the fans after his single against the Kansas City Royals during the first inning of a baseball game Saturday, Sept. 22, 2018, in Detroit. Martinez, playing in his final game, was removed for a pinch-runner after the single. (AP PhotoCarlos Osorio)

Detroit Tigers designated hitter Victor Martinez acknowledges the fans after his single against the Kansas City Royals during the first inning of a baseball game Saturday, Sept. 22, 2018, in Detroit. Martinez, playing in his final game, was removed for a pinch-runner after the single. (AP PhotoCarlos Osorio)

Tigers starter Jordan Zimmermann allowed two runs on three hits in seven innings. He walked two and struck out five. Joe Jimenez (5-4) allowed the Royals to tie it in the eighth but earned the win.

Shane Greene allowed a solo homer to Perez before finishing the ninth for his 31st save in 37 opportunities.

Jake Junis entered the game with a 4-0 record and 1.76 ERA against the Tigers this season. He gave up three runs on eight hits, a walk and three wild pitches in six innings.

Detroit Tigers designated hitter Victor Martinez holds back tears during an on-field ceremony before the team's baseball game against the Kansas City Royals on Saturday, Sept. 22, 2018, in Detroit. Martinez, playing in his final game, has said he wants his final at-bats to be in front of the home fans. (AP PhotoCarlos Osorio)

Detroit Tigers designated hitter Victor Martinez holds back tears during an on-field ceremony before the team's baseball game against the Kansas City Royals on Saturday, Sept. 22, 2018, in Detroit. Martinez, playing in his final game, has said he wants his final at-bats to be in front of the home fans. (AP PhotoCarlos Osorio)

Whit Merrifield drove the game's first pitch to right-center. JaCoby Jones made a diving try but the ball popped out of his glove when he hit the ground, giving Merrifield a triple. Adalberto Mondesi followed with a sacrifice fly.

The Tigers tied the game in the bottom of the inning on Goodrum's RBI single, and he added an RBI double in the third.

Alex Gordon tied it at 2-2 with a fourth-inning homer. Two wild pitches by Junis allowed Jones to score the go-ahead run in the bottom of the inning.

Detroit Tigers designated hitter Victor Martinez is presented a chair by Al Avila, executive vice president of baseball operations and general manager, before the Tigers' baseball game against the Kansas City Royals, Saturday, Sept. 22, 2018, in Detroit. Martinez is playing his final game, and said he wants his final at-bats to be in front of the home fans. (AP PhotoCarlos Osorio)

Detroit Tigers designated hitter Victor Martinez is presented a chair by Al Avila, executive vice president of baseball operations and general manager, before the Tigers' baseball game against the Kansas City Royals, Saturday, Sept. 22, 2018, in Detroit. Martinez is playing his final game, and said he wants his final at-bats to be in front of the home fans. (AP PhotoCarlos Osorio)

Brett Phillips singled off Jimenez with one out in the eighth and scored the tying run on Merrifield's double down the left-field line.

TRAINER'S ROOM

Tigers: Infielders Jeimer Candelario (back) and Niko Goodrum (quadriceps) returned to the lineup. Candelario played third, while Goodrum started at second before moving to first after Martinez's departure.

Kansas City Royals' Brett Phillips is greeted in the dugout after scoring during the eighth inning of the team's baseball game against the Detroit Tigers, Saturday, Sept. 22, 2018, in Detroit. (AP PhotoCarlos Osorio)

Kansas City Royals' Brett Phillips is greeted in the dugout after scoring during the eighth inning of the team's baseball game against the Detroit Tigers, Saturday, Sept. 22, 2018, in Detroit. (AP PhotoCarlos Osorio)

KOZMA RARITY

Pete Kozma tripled in the eighth inning — his first three-base hit in the majors since Sept. 21, 2012. Kozma's first triple as a Tiger put him one ahead of Martinez, who finished his Detroit career with zero triples in 969 games.

MARTINEZ'S FINAL DAY

Kansas City Royals' Brett Phillips beats the throw to Detroit Tigers catcher James McCann to score during the eighth inning of a baseball game Saturday, Sept. 22, 2018, in Detroit. (AP PhotoCarlos Osorio)

Kansas City Royals' Brett Phillips beats the throw to Detroit Tigers catcher James McCann to score during the eighth inning of a baseball game Saturday, Sept. 22, 2018, in Detroit. (AP PhotoCarlos Osorio)

Martinez was honored in a pregame ceremony that included a video tribute and gifts for his family presented by the team's other Latin American players, including Miguel Cabrera, who had been away from the team while rehabbing his biceps injury.

There were also presents from Martinez's teammates and the Tigers organization. In honor of his future career as a cattle rancher, the gifts included handmade cowboy boots and a saddle emblazoned with the Tigers logo.

After taking time to compose himself, Martinez thanked the fans in a brief speech. He played first base for the first time since June 1, 2016, ending a 342-game streak of only serving as a hitter.

Kansas City Royals' Alex Gordon rounds the bases after his solo home run as Detroit Tigers starting pitcher Jordan Zimmermann (27) walks on the mound during the fourth inning of a baseball game Saturday, Sept. 22, 2018, in Detroit. (AP PhotoCarlos Osorio)

Kansas City Royals' Alex Gordon rounds the bases after his solo home run as Detroit Tigers starting pitcher Jordan Zimmermann (27) walks on the mound during the fourth inning of a baseball game Saturday, Sept. 22, 2018, in Detroit. (AP PhotoCarlos Osorio)

UP NEXT

The teams finish their four-game series Sunday afternoon in Detroit's final home game of the season. Brad Keller (8-6, 3.17 ERA) will start for the Royals against Daniel Norris (0-5, 5.71).

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

Detroit Tigers starting pitcher Jordan Zimmermann throws during the second inning of the team's baseball game against the Kansas City Royals, Saturday, Sept. 22, 2018, in Detroit. (AP PhotoCarlos Osorio)

Detroit Tigers starting pitcher Jordan Zimmermann throws during the second inning of the team's baseball game against the Kansas City Royals, Saturday, Sept. 22, 2018, in Detroit. (AP PhotoCarlos Osorio)

Detroit Tigers designated hitter Victor Martinez hugs a family member before a baseball game Saturday, Sept. 22, 2018, in Detroit. Martinez is playing his final game Saturday and said he wants his final at-bats to be in front of the home fans. (AP PhotoCarlos Osorio)

Detroit Tigers designated hitter Victor Martinez hugs a family member before a baseball game Saturday, Sept. 22, 2018, in Detroit. Martinez is playing his final game Saturday and said he wants his final at-bats to be in front of the home fans. (AP PhotoCarlos Osorio)