Strasburg (3-5) allowed five hits in eight innings, walked none and struck out a season-high nine, giving up a run in the eighth on his first big league balk. He lowered his ERA to 2.49 in a season when his team's offense has been lacking to the point manager Davey Johnson vowed to stop shaving until it improves.
Making his latest no-support start, Hamels (1-8) struck out six and allowed only three hits through six innings. Ryan Zimmerman's infield single started a rally that included a pair of errors and Steve Lombardozzi's two-run double. Hamels has lost five straight starts, has had only 20 runs of support scored all season when he's been in the game and hasn't pitched with a lead since April 7.
Washington set a season high for runs in an inning in the seventh.
After Zimmerman's hit, Adam LaRoche singled and a one-out walk loaded the bases for Jhonatan Solano, who hit a broken-bat dribbler to third. Michael Young charged the ball but made a low throw to home, the ball scooting away to as two runners scored on the error.
Lombardozzi's double chased Hamels, and Denard Span hit an RBI double off Justin De Fratus.
Strasburg was within striking distance of his first complete game in 56 major league starts but was taken out after 112 pitches and replaced by Tyler Clippard.
Nationals right fielder Bryce Harper appeared to reinjure his left knee, initially hurt when he ran into the wall at Dodger Stadium on May 13. Harper favored the knee after he slid twice in the first inning - getting to second on an infield hit and error and reaching third on a stolen base. He was removed from the game for a pinch runner after walking in the seventh.
Beset by injuries and poor hitting, the Phillies and Nationals are hovering near each other in mediocrity with one-third of the season almost gone. A Philadelphia win would have put both teams at 25-25.
Perhaps sensing their offenses needed all the help they could get, Hamels and Strasburg accounted for half of the game's hits through six innings. Hamels tried to give himself some rare run support when he led off the third with a single, but he didn't get past second base. Strasburg poked a one-out double down the right- field line in the third and led off the sixth with a single, but he was stranded both times.