It was the fourth consecutive win for Shields (12-7), who gave up just three hits and one run through seven innings. He struck out seven and walked one. Fernando Rodney pitched a 1-2-3 ninth for his major-league best 39th save.
Kansas City starter Luis Mendoza (7-9) took the loss in a 4 1/3-inning outing in which he was charged with five hits and two runs. He also walked four.
The Royals got their first two hits and a 1-0 lead against Shields in the second inning when Salvador Perez doubled and scored on a Jeff Francoeur. But Kansas City managed just one more hit until the seventh.
The Rays gave Shields a lead in the third when Ben Zobrist had a sacrifice fly and Jeff Keppinger an RBI single. Ryan Roberts doubled in Carlos Pena in the sixth and Zobrist doubled in Sam Fuld an inning later as Tampa Bay went up 4-1.
Kansas City's two-run eighth inning was highlighted by an RBI -triple from Alcides Escobar, who then scored on a groundout. Tampa Bay's Jose Lobaton hit his second home run of the season in the bottom of the inning.
Senate Democrats to pull all-nighter on climate change
Interpol investigating stolen passports on missing flight