The Kansas City Royals are playing with confidence right now in the late innings.

Salvador Perez and Mike Moustakas hit consecutive homers in the 12th, and the Royals won their sixth straight game, 5-3 over the Detroit Tigers on Monday night. Six of Kansas City's last eight victories have come in the team's final at-bat, and on this night, the bullpen held off Detroit long enough for the Royals to break through.

"You knew if we could just keep getting good relief pitching to give us an opportunity, that we'd find a way," Kansas City manager Ned Yost said.

Hours after the Royals helped their pitching staff by acquiring Trevor Cahill and two relievers in a trade with San Diego, Kansas City outlasted the Tigers to stay 1 ½ games behind first-place Cleveland in the AL Central. Jorge Bonifacio also homered for the Royals, who won despite squandering a 3-0 lead in the sixth.

Jakob Junis (3-2), one of seven relievers used by Kansas City, pitched a hitless 11th for the win. Kelvin Herrera finished for his 20th save in 23 chances.

Drew VerHagen (0-1) took the loss, allowing the homers to Perez and Moustakas in his third inning of work.

Perez put the Royals up 4-3 with his 20th homer of the year, a line drive that stayed inside the foul pole in left field, to lead off the 12th. Moustakas followed with a drive to right for his 29th home run of 2017.

"VerHagen could have thrown 100 pitches if we needed him, and we were so short in the bullpen that we didn't have many other options," Detroit manager Brad Ausmus said. "I thought he did a very good job, except for hanging two breaking balls. You can't do that to hitters like Perez and Moustakas."

Amid ongoing speculation he could be traded soon, Justin Verlander allowed three runs and five hits in seven innings for Detroit. He struck out nine and walked two.

Kansas City starter Jason Hammel allowed three runs and five hits in 5 2/3 innings.

Kansas City scored first when Bonifacio came home on a wild pitch in the fourth. Moustakas added a sacrifice fly later that inning to make it 2-0.

Bonifacio led off the sixth with his 14th home run, but Detroit scored three runs in the bottom of the inning. Miguel Cabrera hit an RBI single, and Alex Avila lined a two-out, two-run single to left-center off reliever Scott Alexander. It was Avila's third hit all season off a left-hander.

ADDITONS

The Royals announced their trade with San Diego about 40 minutes before the first pitch. They received Cahill and relievers Brandon Maurer and Ryan Buchter.

"They're going to be welcome with open arms," Hammel said. "We're trying to do something special here, and I know that the front office is trying to help out this team."

UP NEXT

Royals: LHP Danny Duffy (6-6) starts Tuesday night against Detroit.