Updated

After an impressive stint for the Houston Astros in June, starter Dallas Keuchel has taken a step backward.

Keuchel was charged with seven runs and seven hits with six walks in four-plus innings, and the Astros were pounded by the Milwaukee Brewers 10-1 on Tuesday night.

"I was battling all night," Keuchel said. "I'd just like to cut the walks down and get back to pitching like I did the first four starts up here."

Keuchel (1-4), who has split time between the big league club and the minors this season, had three starts for the Astros in June and didn't give up more than one run in any of them — including a complete-game victory.

But he has had a tougher time since then.

"I think it's command," Astros manager Brad Mills said. "When he first got here he was right on top of everything and now since he's been back it just hasn't been quite as crisp so we're going to work back and try to make sure we can get him back to where he has that comfort level of being crisp."

Aramis Ramirez and Corey Hart each hit a three-run homer for Milwaukee. Ramirez had three hits and four RBIs, including his 13th homer of the season in the third inning. Hart hit his three-run shot in the fifth, his 20th homer.

"You can't give them hitters' counts," catcher Chris Snyder said of the Brewers. "They've still got plenty of power, they've got plenty of good hitters and they were in hitters' counts all night long."

Snyder hit his fifth home run of the season for Houston.

Brewers starter Yovani Gallardo (9-8) went seven innings, giving up one run and three hits with a walk and five strikeouts.

"When you're working from out front like he was, you have a tendency to be able to take a few more chances, maybe, and put balls on the plate," Mills said. "And to me, that's what that looked like."

And this time he wasn't betrayed by the Brewers' leaky bullpen, as Jim Henderson got out of a bases-loaded jam in the eighth and Francisco Rodriguez pitched a perfect ninth.

Home plate umpire Brian Knight ejected Brewers manager Ron Roenicke and bench coach Jerry Narron in the ninth.

After Norichika Aoki led off the first with a single and Braun took a one-out walk, the Brewers used a double-steal to put runners on second and third. Aramis Ramirez singled to score Aoki and give Milwaukee a 1-0 lead.

Neither the Astros or Brewers pulled off any last-minute deals before Tuesday afternoon's non-waiver trade deadline. Both team, however, pulled off selling-minded trades earlier in the month — Houston made a series of moves, while Milwaukee sent ace pitcher Zack Greinke to the Angels last week.

With runners on first and third with one out in the second, Gallardo laid down a perfect squeeze bunt, allowing Weeks to score from third for a 2-0 lead — and the Astros weren't able to throw Gallardo out at first, leaving runners on first and second with one out.

But Aoki hit into a double play to end the inning, and Snyder led off the third with a homer to cut the lead to 2-1.

The Brewers broke the game open in the third, when Carlos Gomez doubled, Braun walked and Ramirez hit a three-run homer. Keuchel issued another pair of walks before getting Cody Ransom to hit into an inning-ending double play.

Milwaukee ended its first three innings on double plays but still led 5-1.

Keuchel gave up singles to Braun and Ramirez to start the fifth, and was taken out of the game. Reliever Chuckie Fick then gave up the three-run homer to Hart and the Brewers led 8-1.

Fick hit Gomez with a pitch in the left wrist in the sixth, and Gomez briefly looked like he was going to charge the mound. But Gomez — who also was hit Monday night — quickly calmed down and took first base.

Brewers reliever Jim Henderson loaded the bases with two outs in the eighth, then struck out Brett Wallace to end the inning.

Pinch-hitter Nyjer Morgan added a two-run single in the ninth.

NOTES: Mills said before the game he doesn't intend to formally name a closer for now, but wants to give Wilton Lopez get a shot at the role. ... Tuesday's attendance was 30,011.