WASHINGTON — The Washington Nationals watched their winning streak end in deflating fashion Saturday night.
Now the question is whether or not they can recover and stay in the wild-card race.
The Nationals rallied from a 5-1 deficit and had the tying run on base in each of the final three innings, but lost to the Philadelphia Phillies 5-4.
Washington fell 5 1/2 games behind the Reds (winners in Milwaukee) for the second NL wild card.
"We're still fine, we've just got to win the games," manager Davey Johnson said. "Just got to keep winning."
After they pulled to within 5-4 in the seventh, they stranded a runner on second in the eighth and had a final chance in the ninth when Ryan Zimmerman doubled off Jonathan Papelbon to lead off.
Jayson Werth flied out and after Ian Desmond popped out, Bryce Harper, who had singled in his previous at-bat, was walked intentionally. Papelbon retired Wilson Ramos on a hard grounder to short to end it.
"Just the better matchup," Phillies manager Ryne Sandberg said. "Sometimes Harper seems to make things happen, as he did earlier with the broken-bat base hit."
Johnson said "It was a fun game for me. I mean there was all kinds of strategy going on. You could hear the wood burning over on the other side, and certainly burning on our side. But it just didn't happen."
Washington's Denard Span (3 for 5) extended his hitting streak to 25 games and stole a career-high three bases.
"We left some opportunities to win (out there) tonight," Span said of an offense that went 2 for 16 with runners in scoring position and left 11 men on.
Carlos Ruiz had two doubles and three RBIs and John Mayberry homered for the Phillies.
Gio Gonzalez (10-7) was coming off a one-hitter against the Mets and allowed four runs on nine hits in six innings.
Cole Hamels (8-13) won his fourth straight decision, allowing four runs, three earned, on eight hits in six-plus innings.
Pinch-hitter Scott Hairston, Span and Zimmerman singled to load the bases in the seventh and end Hamels' night.
Facing Justin De Fratus, Jayson Werth grounded to third and Cody Asche threw home for the out. Ian Desmond plated Span with a sacrifice fly to make it 5-2.
Left-hander Cesar Jimenez came in to pitch to Harper and Harper blooped a single to center to score Zimmerman. When center fielder Cesar Hernandez overran the ball, Harper went to second and Werth scored from first.
B.J. Rosenberg fanned Ramos on a called third strike.
Philadelphia took the lead in the fifth. With one out, Mayberry hit an 0-1 offering from Gonzalez into the visitors' bullpen to tie the score.
The Phillies weren't done as Hamels and Hernandez followed with singles. Rollins flied out, but Chase Utley walked to load the bases. After pitching coach Steve McCatty visited Gonzalez, Ruiz hit the left-hander's first pitch over Werth's head in right for a bases-clearing double.
"I was one pitch away from getting out of the inning," Gonzalez said.
Since Aug. 8, Ruiz is batting .583 (14 for 24) with runners in scoring position, with six doubles and 19 RBIs.
Utley added what turned out to be a crucial RBI-single in the seventh to make it 5-1.
Washington took the lead in the first. Span singled, stole second, went to third on a wild pitch and scored on Werth's sacrifice fly.
The Nationals had runners on second and third with one out in the third, but failed to score. Bryce Harper hit a grounder to short and Ian Desmond broke for third, but Werth, the runner on third, held. Desmond was chased down for the out and Wilson Ramos struck out.
"I made a pretty big mistake running on that ball," Desmond said. "It kind of flipped the momentum."
NOTES: Johnson said RHP Stephen Strasburg (forearm tightness) will play catch Sunday. If that goes well, the next step is a bullpen session Monday in anticipation of a start on Thursday, one day after what would have been his next regular turn. RHP Ross Ohlendorf, who started Friday in place of Strasburg, will start on Wednesday. ... LHP Ross Detwiler (back strain), on the disabled list since July 4, threw a bullpen session Saturday. Johnson said he'll throw one more before facing hitters in a simulated game or batting practice session. ... Washington's Jordan Zimmerman (17-8, 3.36) opposes Tyler Cloyd (2-4, 4.56) in Sunday's series finale.