Kansas City's bats came to life a little too late against Tampa Bay's James Shields on Wednesday

Shields took a three-hitter into the eighth inning, leading the Rays to their 16th win in 21 games with a 5-3 victory that marked only the second series loss of the month for the Royals.

"Shields is a great pitcher," said losing pitcher Luis Mendoza. "Our guys battled and they were there. They scored three runs and I tried to keep us in the game."

Shields (12-7) retired 12 in a row after Alcides Escobar's two-out single in the third and allowed three runs and five hits in 7 2-3 innings. The right-hander struck out seven and walked one, improving to 4-0 with a 2.15 ERA in his last five starts.

Escobar ended Shields' day with a two-out RBI triple in the eighth that pulled Kansas City to 4-2. Jake McGee allowed a run-scoring single to Alex Gordon before Kyle Farnsworth retired Billy Butler on a grounder.

Jose Labaton homered off Aaron Crow leading off the bottom half, and Fernando Rodney pitched the ninth for his 39th save in 41 chances.

Mendoza (7-9) gave up two runs, five hits and four walks, hit a batter and balked before Royals manager Ned Yost brought in the first of four relievers with one out in the fifth inning.

"With Shields on the mound, you know you can't give them too much leeway," Yost explained. "I just decided I was going to try to keep (the margin) at two, but the tack-on runs in the sixth, seventh and eighth did us in."

Mendoza threw 43 of his 81 pitches for strikes.

"I struggled with my command," he said. "I tried to pitch carefully today and I put runners on base and then (Roberts) got a big hit. The bases on balls hurt you."

Tampa Bay won two of three in the series, limiting the Royals to just five runs and 18 hits. Tampa Bay leads the AL with a 3.27 ERA.

"These guys have tremendous starting pitching, a tremendous bullpen," said Yost. "It's a team you don't really want to come in and play because they're coached well, they're managed well, they play the game right and their pitching is just phenomenal.

"That being said, I thought we came in here and matched up pretty good in the three-game set."

Yost was ejected in the eighth by plate umpire Scott Barry for arguing after Eric Hosmer took a called third strike.

Jeff Francoeur's RBI single put Kansas City ahead in the second, but the Rays took a 2-1 lead in the third on Ben Zobrist's sacrifice fly and Jeff Keppinger's RBI single. Ryan Roberts doubled in a run in the sixth, and the Rays made it 4-1 in the seventh on an error at second by Escobar, who couldn't handle Francoeur's throw from right on Zobrist's double.

NOTES: Tampa Bay went 1 for 8 with runners in scoring position through the fifth and 1 for 13 overall. ... It was the first series loss for the Royals since they dropped two of three against Texas on Aug. 3-5 . . . The ejection was Yost's third of the season and 29th of his career . . . Tampa Bay begins a three-game home series Thursday night against Oakland that ends Saturday. The Rays don't play on Sunday due to Tropicana Field being used for next week's Republican National Convention. ... The Royals are off Thursday before a four-game series at Boston.