HOUSTON -- Salvador Perez went to the plate in the eighth inning of a tied game Wednesday looking for a pitch he could get the barrel of the bat on and pull toward the left-field fence at Minute Maid Park.
The victory was the fourth in five games for the Royals, who have two wins in the first three games of the four-game series.
Perez's homer off from Ken Giles (0-1) came after the Astros reliever walked Alex Gordon. Earlier in the game, Perez lifted a sacrifice fly that scored the Royals' second run. He boosted his season RBI total from one to four.
"I tried to protect the zone and (Giles) was too aggressive, and I hit it out," said Perez, who said he knew as soon as he made contact that it would clear the wall.
"That was my first time facing (Giles). He has a pretty good slider. He left that one a little up. We are going to play hard to the last out and see what happens."
Perez's long ball made a winner out of Luke Hochevar (1-0) despite the fact that Hochevar allowed the tying run on a run-scoring double by Jose Altuve in the seventh.
Joakim Soria retired all three batters he faced in the ninth to earn his first save of the season and first in Kansas City uniform since 2011.
"Soria comes in and boom, boom, boom -- a five-pitch save," Royals manager Ned Yost said. "He's usually real efficient, and he's a strike-thrower with three pitches. He's got 203 saves now, and he has good stuff and he's a good candidate (to close) on the days we don't have (regular closer) Wade (Davis). We have a bullpen that you can mix around."
Soria rejoined the Royals this season after sitting out all of 2012 and pitching for the Texas Rangers in 2013, the Rangers and the Detroit Tigers in 2014 and the Tigers and the Pittsburgh Pirates last season.
"My parents were here, and it was so good for them to see me pitch again as a Royal and get the save," Soria said. "Houston sometimes just swings at the first pitch. It happened with the first two batters, and they hit it to our players. It is a long season, so we just need to keep fighting and keep battling and make everything good."
Dominating pitching ruled the first half of the game as the Royals' Yordano Ventura and the Astros' Scott Feldman dueled through five scoreless frames.
The Royals (6-2) put runners on the corners with one out in the sixth on consecutive singles by Lorenzo Cain and Eric Hosmer. Kendrys Morales then hit a slow bouncer between the mound and third base that Feldman fielded and then threw wildly over first baseman Tyler White's head for an error that allowed Cain to score.
Feldman then intentionally walked Gordon to load the bases, and Perez hit a sacrifice fly to left to plate Hosmer and expand Kansas City's lead to 2-0.
The Astros (3-6) got one of those runs back in the bottom of the frame via a solo home run onto the train tracks above left field by Altuve. Houston loaded the bases with two outs on a walk, a single by White and an error behind second base by Escobar, but Ventura coaxed Carlos Gomez into a check-swing grounder to second base to end the threat.
"Certainly that inning will stick out in (Feldman's) mind as a missed opportunity with a slow runner and a rushed throw," Houston manager A.J. Hinch said. "He escaped it without major damage, but in close games with two good teams, some of these little things stand out as bigger when you reflect back."
Castro tripled with one out in the seventh off Hochevar and came home on a hustling double by Altuve.
"That's the game sometimes, you're going to find men on bases and you're going to score them sometimes and sometimes no," Altuve said. "Perez is a big guy with a big swing. He's going to (homer) between 15 and 20 times per season, and he did it tonight to win the game. You have to give the credit to him."
Ventura allowed one run in six innings, while Feldman gave up two runs, both unearned in 6 1/3 innings. Neither was involved in the decision.
NOTES: The Astros have faced a right-handed starter in all nine of their games this season and are scheduled to face righties in their first 13 contests. Overall, the Astros had just 26 plate appearances against lefties in their first eight games before Wednesday and are hitting .333 (8-for-24) in those opportunities. ... The Royals, the best road team in the major leagues over the past three seasons, are 2-1 away from home in 2016. Kansas City compiled a major-league-best 133-110 road record from 2013-15, leading the Los Angeles Dodgers by two games in that span. ... Heading into Wednesday's game, Houston 1B Tyler White had more hits (13) and home runs (3) than any Astros player has ever collected in his first eight career games. ... Four of the first five wins for the Royals entering play Wednesday were by one run. Kansas City was 23-17 in one-run contests a year ago.