PHILADELPHIA -- Jordan Zimmermann and a pair of defensive gems were enough to keep Washington's postseason hopes flickering.
Zimmermann (16-8) struck out five, walked one and allowed two runs in winning his fourth straight start.
Jake Diekman (1-4) walked the leadoff batter in the eighth, then allowed pinch-runner Jeff Kobernus to score on a fielder's choice for the winning run.
The Nationals sat outfielder Bryce Harper to rest his ailing hip. They are still barely alive behind Cincinnati for the second wild-card spot
"We don't think we're out of it yet," Nationals manager Davey Johnson said.
The Phillies wasted a chance to tie the game in the eighth with runners on first and third and one out.
Craig Stammen struck out Darin Ruf and the ball scooted away from catcher Jhonatan Solano on strike three. Chase Utley was tagged out on a mad dash for home by a lunging Solano for the strike `em out-tag `em out double play.
"It was a great play. That's how we won the game," Stammen said.
Zimmermann got out of his own jam in the seventh thanks to a fantastic defensive play. Cesar Hernandez hit a grounder into the hole that second baseman Steve Lombardozzi fielded and one-hopped to Zimmerman at the bag for the third out to prevent the tying run from scoring.
"I knew I had to scoop it and keep my feet on the bag at the same time," the pitcher said.
Rafael Soriano worked the ninth for his 38th save.
Phillies starter Roy Halladay survived a miserable first inning to end up allowing three hits over six innings. Four months after right shoulder surgery, this certainly wasn't vintage Halladay. He walked five and hit two batters. He labored through a 29-pitch first inning.
But the two-time Cy Young Award winner struck out five after fanning four combined in his last two starts. He settled down after he hit or walked five of the first 10 batters he faced.
And he kept the Phillies in the game.
"It took me a little bit to find the right balance, mechanically," Halladay said. "That's going to be a little bit of a battle at times."
Laboring to hit 90 mph with his fastball, Halladay allowed the first three batters of the game to reach, then gave up a sacrifice fly. Wilson Ramos hit into a double play to end the rally and keep Halladay in the game.
He caught another break in the sixth. After retiring the first two batters, Halladay loaded the bases with two outs. Johnson decided to leave Zimmermann in the game, instead of pinch-hitting for his starter after 77 pitches. Zimmermann was retired and Halladay walked off to an ovation.
"I was feeling sorry for him the first couple of innings," Johnson said. "Then I started to hate him as he went along."
Halladay left with a 2-1 lead thanks to Hernandez's two-run double in the second inning.
"His innings got better with the lead," Phillies interim manager Ryne Sandberg said. "The Nationals' at-bats started to change a little bit."
Clearly struggling with his velocity, Halladay went with the soft stuff for most of his final four innings, and had the most effective of his three outings since returning from a rehab assignment. He is a free agent at the end of the season and wants to prove to the Phillies, or any team, that he can still be a reliable starter. He'll have three or four more starts in the final month to prove he can come close to his former All-Star form.
"I think if put in the work and put in the time, I can have those results," he said.
The Nationals will start RHP Tanner Roark on Saturday against Miami, meaning RHP Stephen Strasburg will likely go Sunday on six days' rest. Roark had been pitching in long relief. ... Halladay made his 100th start for the Phillies. ... Denard Span's leadoff single extended his hitting streak to 17 games, the longest for the Nationals this season.