It was 99 degrees at first pitch but it still took a few innings for the Royals’ bats to heat up Sunday in the rubber match of a three-game series with the division-leading Detroit Tigers at Kauffman Stadium.

But once they got going the Royals backed Bruce Chen with a 10-hit attack including three knocks from Eric Hosmer in a 5-2 win that pulled the Royals within three games of the second American League Wild Card pending other results.

“We know we’re close and we’re going to come out here and keep fighting until the end” said Hosmer whose average ticked up to .302 with a three-for-four performance.

It was Hosmer’s majestic three-run home run in the fifth inning — a high-arching 414-foot blast off Doug Fister — that brought the Royals back from an early two-run deficit.

“Every hack he takes right now he’s real confident in the box and feels real good about his swing” manager Ned Yost said. “He’s seeing the ball really really well. … He barreled that one up pretty good.”

Fister who was handed a 2-0 lead on Jose Iglesias’ two-run home run in the third inning wriggled out of a fourth-inning jam giving back only one run.

Fister 12-8 then retired the first two batters in the fifth before Alex Gordon reached on a sharp infield grounder which popped out of a diving Victor Martinez’s glove.

Emilio Bonifacio followed by dumping a single into right field before Hosmer jacked a 2-2 fastball from Fister over the wall a few feet right of dead center for his 16th home run.

“He’s got that good life on his two-seam fastball and with two strikes he was getting a lot of our guys inside” Hosmer said. “He’ll start it at you and try to freeze you. It’s one of those situations with a couple guys on base I had a feeling he was coming with it. I put a good swing on a changeup earlier so I took a chance and fortunately enough it worked out.”

Meanwhile Chen retired five of the Tigers’ first seven batters on flyballs before Alex Avila slapped an opposite-field single into left field ahead of Iglesias’ home run to left.