Miami had beaten the All-Star left-hander three times this season, and his ERA in those games was 5.21. The Marlins had also defeated the Phillies in five consecutive games.
But in the series opener, Hamels was in control, striking out five on his way to his second straight shutout victory.
Runs have been hard to come by for the Marlins, who have now been blanked in back-to-back games. On Sunday, they were shut out, 5-0, by the Dodgers, as Chris Capuano carried a no-hitter into the seventh inning.
"Good pitching. We faced two good pitchers," Marlins manager Ozzie Guillen said. "Our lineup is not the one we want right now. We got a couple guys hurt. ... [Greg] Dobbs is playing hurt right now, sort of.
"Our offense is not there. [Jose] Reyes is our offense right now. I'm not going to take away any credit from the people we faced. Hamels was Hamels."
The Marlins are now a season-worst 12 games under .500, falling to 52-64. They've also been shut out 12 times, the most in the Majors.
The Marlins were blanked in back-to-back games for the first time since Sept. 27-28, 2009.
Reyes did go 2-for-4, giving him hits in 29 of 30 games.
Hamels got into trouble in the first inning, allowing a leadoff single to Donovan Solano. With one out, Reyes singled to right, advancing Solano to third. But on the play, Reyes got caught in a rundown as he tried to stretch the hit into a double. Reyes was tagged out. And the threat ended when Hamels struck out Giancarlo Stanton.
Hamels worked around a two-out double to Stanton and finished up his shutout in 113 pitches. Overall, the lefty has a string of 22 straight scoreless innings.
"Obviously, I haven't done too well against them recently, but it's just a matter of making pitches and trying to pick the target and be precise with it," Hamels said. "I feel healthy and feel confident in all four pitches. It's just a matter of being able to execute."
The only other time the Marlins had a runner reach third was the seventh inning, when Austin Kearns was stranded.
Marlins right-hander Nathan Eovaldi gave up three runs (two earned) in five innings.
Making his fourth start with Miami, Eovaldi continues to struggle with high pitch counts.
The 22-year-old right-hander was lifted after five innings and 103 pitches. Eovaldi was able to minimize damage and was hurt by an error, but he kept the Marlins within striking distance.
"He has to throw strikes," Guillen said. "He's a kid. We have to figure out how to help him. I don't care how much good stuff you have, if you don't throw strikes, you're going to run into trouble, and that's what I see with him.
"We all know you have to be around the plate. If you're not around the plate and your breaking ball is not working, that's double trouble. He got lucky they didn't score that many runs. They could've had a big, big, big, big game. He pitched good enough that they didn't score that many runs."
A sparkling defensive play also helped the Eovaldi, who was acquired from the Dodgers on July 25 as part of the Hanley Ramirez trade.
Eovaldi was bailed out in the second inning by Stanton, who saved a run with a terrific running, diving catch in right-center to rob Erik Kratz of extra bases. The two-out grab prevented Domonic Brown, who singled to lead off the inning, from scoring.
Stanton's sprawled-out catch was one of the best plays by a Marlins player this season.
But the Phillies were able to cash in and score a couple of runs in the third inning. One was unearned.
With one out, Jimmy Rollins and Juan Pierre singled, putting runners on the corners. Chase Utley ripped an RBI double to right. A walk to Ryan Howard loaded the bases. Philadelphia tacked on a second run on John Mayberry Jr.'s two-out grounder to third that was booted by Dobbs. Pierre scored on the error.
Some sloppy baserunning in the third inning, when the Marlins attempted a double-steal with two outs and Carlos Lee batting, prompted Guillen to shut down the running game. Justin Ruggiano was tagged out at third with Lee at the plate in a two-run game.
"We ran the bases very well today," Guillen said, rolling his eyes. "Thrown out at third base, then a guy got run down with one out [Reyes in the first inning]. We did not run the bases too well today. That's the opportunity we had. We had a couple opportunities, and we shut it down because we didn't run the bases well."
Pierre did some more damage in the fourth inning with a two-out RBI triple, scoring Rollins from first to make it 3-0.
Eovaldi is 2-2 since the trade, and his longest stint is 5 1/3 innings. To go deeper into games, he recognizes he has to pound the strike zone better.
"Attack the zone and get quicker outs," he said. "Use my offspeed pitches. I had too many offspeed pitches just starting away, off the edge of the plate. I have to use it more as a contact pitch, throw it down the middle and show it like it's a fastball, and induce some ground balls."