Hamels, the MVP of last season's NL championship series and World Series, allowed one run and five hits in eight strong innings. Hamels (10-9) even chipped in with an opposite-field RBI single to help the NL East-leading Phillies win their fifth straight game.
Brad Lidge gave up a run in the ninth before finishing for his 30th save in 40 chances.
Hamels was as sharp as he's been all season and continued a sensational string of quality starts from Philadelphia's rotation. He finally ran into trouble in the seventh when he gave up a run and loaded the bases. The left-hander got Mike Morse to fly out and struck out Josh Bard to escape the jam.
Hamels retired the first 15 batters before Morse led off the sixth inning with a clean single to left. He quickly regrouped against the last-place Nats, striking out Bard, Jorge Padilla and Justin Maxwell to end the inning.
Hamels got some help in the fourth when third baseman Pedro Feliz made a leaping catch to rob Ryan Zimmerman, sending a spark through the crowd and ending the inning.
The lanky ace was looking at a no-decision until the fifth. Feliz walked and scored on Jimmy Rollins' two-out double into left field for a 1-0 lead.
Ross Detwiler (0-6) had perhaps his finest start of the season, striking out six and allowing one run in five innings for Washington.
Nice, just not close to perfect.
Hamels struggled for most of this season until finding his way again in late August. He's 3-1 in his last five starts and has the Phillies feeling good about their rotation as they inch closer toward their third straight division title. When the Nationals scored off Hamels in the seventh, it ended a streak of 29 straight scoreless innings from the starters.
The Phillies scored twice in the sixth to give Hamels a cushion. Ryan Howard scored on Tyler Clippard's wild pitch and Hamels added his run-scoring single.
Chase Utley scored on a wild pitch in the seventh to make it 4-1.
NOTES: Phillies CF Shane Victorino left in the seventh with a gastrointestinal illness. ... Nationals 3B Zimmerman made a tumbling catch over the tarp and banged his head on the railing to catch Utley's foul pop in the sixth. ... Nationals C Wil Nieves left with a hamstring injury. ... Phillies RHP Chan Ho Park will miss two to three weeks with a strained right hamstring. He has a 2.52 ERA in 38 relief appearances.