Shields engaged in quite the pitchers' duel with the Astros' Jordan Lyles, but the game came down to the bullpens. Houston brought in Wesley Wright (0-2) in the eighth and Hosmer greeted him with a single, and then Butler doubled off Josh Fields for the go-ahead run.
David Lough's RBI double moments later created a cushion for the Royals, who also got a two-run homer from Salvador Perez earlier in the game to help them win three straight for the first time since May 1-5 -- a stretch interrupted twice by weather postponements.
"I feel like the offense is starting to come around a bit," said Royals manager Ned Yost, who praised Hall of Famer George Brett for his work since taking over as interim hitting coach.
"George has done a good job of loosening them up and putting them in a good position to hit," Yost said, "and I think you're starting to see the fruits of his labor here a little bit."
Trevor Crowe and Jason Castro drove in the only runs for Houston, which had won six straight on the road, its best run since July 18-22, 2005.
"That was real tough to drop a game like that, especially coming in close," Fields said. "It's my job to hold the game right there and I wasn't quite as fine as I needed to be."
Shields allowed the leadoff hitter to reach base in each of the first four innings, and again in the seventh, but for the most part the Royals' ace kept limiting the damage.
He left Brandon Barnes standing on third base in the first inning, and induced double-play grounders off the bat of Marwin Gonzalez to end the second and fourth. Shields finally allowed a run when Crowe followed up another leadoff single by Barnes with a triple in the third.
Even then, Shields escaped more trouble by striking out the next three batters.
"Today was a grind day," Shields said. "I think I was in trouble every inning but one, but we made some unbelievable plays on defense."
Lyles matched the former All-Star pitch for pitch, the young right-hander cruising through the first inning before setting the Royals down in order in the second and third.
Kansas City finally got to him in the fourth when Hosmer ricocheted a single off Lyles and Perez sent a pitch sailing over the bullpen in left field for a two-run homer.
Lyles buckled down, though, and the Astros eventually pulled even.
It happened in the seventh after Gonzalez led off with a single. Shields retired the next two batters before Castro's double to right field knotted the game 2-all.
That left both starting pitchers to watch things play out from the dugout.
Lyles, coming off consecutive wins for the first time in his career, gave up six hits and a walk in seven innings. He's allowed two earned runs or fewer in five straight outings.
"For the most part, I threw the ball down in the zone and got some quick outs," he said. "It was all right. You can't get too down about seven innings."
Shields allowed nine hits and three walks in his seven innings but failed to win for the seventh straight start. He hasn't picked up a win since April 30 against Tampa Bay, even though he's only allowed more than two earned runs once over that span.
Not that it matters to him, so long as the Royals win.
"We're playing some baseball now," Shields said. "We're scrapping. I think we're starting to hit better now, we're scoring some runs and it's good to see."
Astros 2B Jose Altuve (groin) was held out of the lineup again. "He wants to play," manager Bo Porter said, "but I'm not going to listen to him. I'm going to listen to the experts and they say he could use another day." ... Royals RHP Felipe Paulino (Tommy John surgery) is expected to begin a rehab assignment at Double-A Northwest Arkansas on Tuesday. ... Astros LHP Erik Bedard faces Royals RHP Ervin Santana on Saturday night.
Copyright by STATS LLC and The Associated Press
KANSAS CITY, MO - JUNE 7: Owner Jim Crane (center) of the Houston Astros talks with former owner Drayton McLane...