Hamels (14-6) gave up eight hits and three earned runs in 7 2-3 innings. He walked just one batter, but gave up a two-run homer to Ryan Braun with two outs in the eighth. Jonathan Papelbon came on and struck out Aramis Ramirez, then pitched a scoreless ninth to record his 27th save.
Hamels entered the game having thrown 22 consecutive scoreless innings over his previous three starts. The stretch included consecutive nine-inning shutouts, against Atlanta on Aug. 7 and Miami on Monday. After retiring the Brewers in order in the first inning, the left-hander, who was the MVP of the 2008 World Series, yielded a home run to Ramirez to lead off the bottom of the second inning.
The Phillies got on the scoreboard first when Mayberry hit a two-run homer over the left field wall with no outs in the top of the second. Mayberry's home run came after Laynce Nix drew a walk to open the inning. Catcher Erik Kratz followed with solo shot to the second level in left field, making it 3-0.
The Phillies added another run in the third when Ryan Howard hit a double, driving in Chase Utley, who led off with a single. The Brewers had a chance to cut into the lead in the bottom of the inning when Lucroy singled with two outs. Braun followed with a shot to the base of the left field wall, but Lucroy inexplicably stopped at second, and Braun was tagged out in a rundown.
Brewers starting pitcher Mike Fiers (6-6) struggled for the second consecutive outing. He gave up four runs, walked four and hit a batter in five innings of work. He struck out five.
Fiers was coming off his worst start of the season on Monday at Colorado when he lasted just two innings, giving up nine hits and eight earned runs. Before that, he had a 1.03 ERA in nine starts.
The Brewers entered Saturday night's contest having won eight consecutive games at Miller Park. A win would have tied a franchise record for consecutive victories at Miller Park set in May of last season.
NOTES: Brewers pitchers had 1,002 strikeouts entering Saturday's game, which led the big leagues. The Brewers have never finished a season leading the league in strikeouts. . The Phillies have a chance to gain a split in the series on Sunday. They haven't lost a series in Milwaukee since 2007. .Brewers pitcher Mark Rogers struck out pinch hitting for Fiers in the fifth inning. Rogers had two hits, including a double, in seven at bats entering the game. . Braun stole second in the sixth inning, giving him 20 stolen bases and 20 home runs in the same season for the third time in his career.