Hamels (9-10) continued to receive little run support, but didn't need much as he breezed to his second straight win and ran his consecutive scoreless innings streak to 18. He allowed three hits and struck out seven.
Hamels was coming off another sparkling effort on Aug. 29 in his hometown of San Diego, when he allowed four hits in eight scoreless innings. Before that, the left-hander had gone 0-3 with five no-decisions in his previous eight outings.
A Milwaukee miscommunication led to the game's only run. Center fielder Lorenzo Cain and left fielder Ryan Braun converged on a Shane Victorino fly ball, but it dropped between them for a double, despite Braun's last-minute lunge.
Victorino moved to third on a Raul Ibanez groundout and scored on Carlos Ruiz's grounder to short.
Hamels took it from there, allowing only two runners to reach second base. In his final inning, Hamels walked Braun and surrendered a single to Prince Fielder, but escaped by retiring Casey McGehee, Cain and Alcides Escobar.
Jose Contreras worked the eighth and Ryan Madson worked the ninth for his fifth save in nine chances. Closer Brad Lidge was unavailable after pitching in three straight games.
The Phillies recorded their 17th shutout of the season, while Milwaukee was shut out for the 11th time.
The fast-charging Phillies, who entered play two games behind NL East-leading Atlanta and two games up in the wild card standings, loaded the bases in the fourth off Chris Capuano (2-3), but didn't score when Ibanez struck out and Carlos Ruiz lined into a double play.
Capuano left after allowing a run on four hits in five innings. Notes: Phillies OF/1B Ross Gload (right groin strain) was reinstated from the disabled list before Friday's game. ... INF Greg Dobbs had his contract picked up from Triple-A Lehigh Valley. ... Brewers OF Corey Hart is 1 for 18 on the first four games of the road trip.