DETROIT — This time, the Kansas City Royals had enough hitting and pitching.

Ian Kennedy pitched three-run ball into the eighth inning, and the Royals stopped a five-game slide by holding off the Detroit Tigers for a 4-3 win on Friday night.

Alex Gordon had three hits for the Royals, who hit four homers in 11-8 loss in the series opener. Rosell Herrera had two hits and drove in a run.

"We made a couple mistakes on 0-2 pitches, and they cost us runs," Royals manager Ned Yost said. "Other than that, our pitching was fantastic."

The sloppy Tigers committed three errors while losing for the eighth time in 11 games.

"We just played terrible baseball," manager Ron Gardenhire said. "We made errors and we made bad decisions."

Kennedy (3-8) won his second straight start, permitting two earned runs and seven hits in seven-plus innings. He struck out six and walked none.

"I've been executing in the last three games — that's literally the only thing that has changed," Kennedy said. "I'm throwing good pitches, and in meaningful spots, I'm throwing strikes."

Wily Peralta worked a shaky ninth for his 12th save. Ronny Rodriguez led off with an infield single, but James McCann bunted into a 1-6 forceout at second.

"Wily's more athletic than he looks," Yost said. "He bounded off the mound and made a great throw to second."

Jeimer Candelario then drew a pinch-hit walk before Peralta struck out Dawel Lugo and Jim Adduci.

Detroit left-hander Francisco Liriano (5-11) was charged with four runs, one earned, and six hits in six innings. He has a 1.88 ERA in his last four starts.

Kansas City jumped in front on Detroit's first defensive mistake. With one out in the first, Adalberto Mondesi singled and took off on a 1-1 pitch to Gordon.

Gordon looped a single to shallow left, and Mondesi took a big turn at third and kept going when rookie Christin Stewart lobbed the ball into second.

"I kept my head up on the play, and I'm always looking to make a play," Mondesi said. "When I saw he was going to make the short throw, I went hard."

Stewart, a hitting prospect not known for solid defence, was making his 12th major league appearance.

"That will be a learning experience for the kid," Gardenhire said. "He's got to be quicker getting to the ball, and he's got to get rid of it. If he makes a faster play and hits the cut-off man, everything is fine."

Gordon added an RBI single in the third, and the Royals scored two more runs in the fourth, aided by errors by first baseman Jarrod Saltalamacchia and Stewart.

"We're going to be working on defence a lot in spring training," Gardenhire said. "We'll have our whole group together and we're going to improve some of these things."

Rodriguez homered in the fifth for the Tigers, and Nicholas Castellanos doubled home a run in the sixth.

Kennedy left after Pete Kozma reached on an error, and Castellanos made it 4-3 with a two-out double off Kevin McCarthy. Victor Martinez, playing in his next-to-last major league game, grounded out to first to end the inning.

Martinez received an ovation before the at-bat.

"I wish I could have gotten a hit there for the fans," he said. "They are like a family to me. Families fight, and there have been some times when they let us know we weren't playing well, but they are always here for us."

TRAINER'S ROOM

Tigers: With INFs Niko Goodrum (quad) and Candelario (back) still bothered by injuries, Harold Castro was promoted from Triple-A Toledo. Castro hadn't arrived by game time, and the Tigers ended up with Saltalamacchia playing first base for the first time since 2016.

ETIQUETTE QUESTION

In the eighth inning, McCarthy rode in on the Comerica Park bullpen cart and didn't know what to do at the end of the ride.

"I had never done that before, so I wasn't sure if I should tip the driver," he said.

ONE MORE GAME FOR MARTINEZ

Martinez announced before Friday's game he will finish his 16-season career on Saturday against the Royals. Martinez will sit out Sunday's series finale and accompany the team on its final road trip without playing.

"I feel like I owe it to the fans to have my final at-bats here," said Martinez, who will be honoured in a pregame ceremony.

UP NEXT

The teams play the third game of their series on Saturday night, with Detroit's Jordan Zimmermann (7-8, 4.41 ERA) facing Jakob Junis (8-12, 4.42 ERA).