Hamels had a perfect game after five innings before Mike Morse led off the sixth with a single to left.
It took another inning before the Nationals got a run across against Hamels. With runners on first and second, Elijah Dukes singled to left to send Ryan Zimmerman home.
Washington should have scored more runs during that sixth inning. After Dukes' at-bat, Ian Desmond walked to load the bases, but Morse flew out to right fielder Jayson Werth and Josh Bard struck out looking to end the inning.
"He was throwing all three pitches when he wanted to," Bard said about Hamels. "You have to tip your hat to him. Obviously, it's frustrating. We have to do a better job finding a way to get runs in. He threw the ball about as good as I've seen him throw it."
Hamels said he seems to bear down when he is in a pennant race during the month of September.
"I think it's being able to go out there, knowing what's at stake," Hamels said. "I think anytime September rolls around, and fortunately enough, I've been here when we've had to win every game. You still have to go out there...
For some odd reason, I seem to bear down a little bit more and compete [in September] and I've been in situations where I've been able to win. It makes baseball more fun."
Left-hander Ross Detwiler gave the Nationals some good news. He lasted five innings and gave up one run on four hits. The lone run scored in the fifth inning, when Pedro Feliz came home on a double by Jimmy Rollins.
It was Detwiler's first start since pitching for Triple-A Syracuse in early September.
"He did a great job for us. He gave us a chance to win the ballgame," interim manager Jim Riggleman said. "We put a five-inning limit on him, so we got him out of there. He could have gone another inning. But with where we are in the season, we decided to shut him down right there. He did a good job and had a pinch-hitter in his spot."
Bard said that Detwiler cleaned up his mechanics after he returned to the big leagues. There isn't much body movement when he is throwing to the plate these days.
"I tried to simplify everything and not have more motion," Detwiler said. "I just try to relax, have [less movement] and throw straight to the plate."
Detwiler is now 0-6 for the season. In his last stint in the big leagues, Detwiler acknowledged that he worried too much about getting his first big-league victory. Since returning to Washington on Sept. 8, Detwiler vowed not think about reaching that goal.
"Before the All-Star break, I was trying too hard to [get that win]. I tried to make everything perfect. Now I'm just able to relax," Detwiler said.
The bullpen then had problems getting people out. With the bases loaded, Saul Rivera walked Carlos Ruiz to score Ryan Howard. Hamels then helped himself by hitting a single to left field to drive in Werth. The runs were charged to Tyler Clippard, who walked two batters in the inning.
Bill Ladson is a reporter for MLB.com. This story was not subject to the approval of Major League Baseball or its clubs.