Justin Maxwell hit a two-run home run to help the Houston Astros survive a 9-7 win over the Kansas City Royals in the opener of a three-game set.

Maxwell had three RBI, Brian Bixler finished the game 3-for-5 with a solo homer and three RBI while Brian Bogusevic added a solo shot for the Astros, who were coming off a three-game sweep at the hands of the Rangers.

J.A. Happ (5-7) pitched six-plus innings in the win as he gave up just two runs on four hits and a walk with three strikeouts to snap a string of four straight losing starts.

"We'd been using our bullpen quite a lot the last few days so it was huge to see him (Happ) go as far as he did," Houston manager Brad Mills said of Happ's outing.

Brett Myers nearly blew the win, though, as he was tagged for eight hits and five runs in the ninth inning before Xavier Cedeno came on to get the last out for his first career save.

Jonathan Sanchez (1-3) was his own worst enemy on Monday. He committed two errors with bad pickoff throws, both of which led to runs, hit two batters, walked four, gave up six hits and four runs -- three earned -- over six innings to drop his third straight decision.

"I made those two errors and it cost me the game," Sanchez said.

Yuniesky Betancourt and Billy Butler each drove in two runs for the Royals, who had won five of six coming into the contest.

The Astros appeared to put the game out of reach in the eighth on Bogusevic's solo homer and Bixler's two-run double that was followed by a two-run shot from Maxwell for a 9-2 lead, but they needed all of it.

Myers got the first batter out to start the ninth, but the next three batters hit singles and Jarrod Dyson plated one with another single. Mitch Maier then lofted a sacrifice fly for the second out and second run of the inning, but four more singles plated three more runs with Betancourt driving in two and Butler one.

After Jeff Francoeur singled to again load the bases, Cedeno came on and got Mike Moustakas to foul out and end the game.

The Royals got on the board in the first inning when Betancourt tripled with one out and later came home on a Francoeur single, but the lead didn't last.

With one out in the bottom of the first, Bixler hit the first home run of his career, a shot over the wall in left. Maxwell then walked and with Carlos Lee at the plate, Sanchez attempted a pickoff. The throw went wild and wound up in foul territory in right field, allowing Maxwell to race all the way home for a 2-1 lead.

The score stayed that way until the fourth when the Astros plated two more. Chris Johnson was hit by a pitch to start the inning and moved to third on another errant pickoff attempt by Sanchez. After Matt Downs flied out, Chris Snyder singled to center to score Johnson. A sac bunt from Happ moved Snyder up a base, Jose Altuve was hit by a pitch and Bixler singled to load the bases. Sanchez's control issues continued to plague him as he then walked Maxwell to force in Snyder for a 4-1 contest.

The Royals were able to get a run closer in the sixth inning. Alex Gordon doubled to start the frame and moved to third on a wild pitch. After Betancourt fouled out, Butler hit into a groundout that allowed Gordon to score.

Game Notes

Kansas City took two of three from Houston at home back in 2010...Each team left seven men on base...Before the game, KC placed second baseman Chris Getz on the 15-day disabled list, optioned pitcher Nate Adcock to Triple-A Omaha and recalled pitchers Louis Coleman and Tommy Hottovy from Omaha...Sanchez fell to 1-3 in five career games against the Astros.