Ian Desmond hit a tying homer with two outs in the ninth inning, then Jonny Gomes was nicked by a pitch from Brad Lidge with the bases loaded in the 10th, giving the Washington Nationals an unlikely 5-4 win over the Philadelphia Phillies on a rainy Sunday.

It was the second improbable victory in three games for the Nationals. They beat the Phillies, who have the best record in the majors, with a six-run rally in the ninth Friday night.

An RBI single by Michael Martinez put the Phillies ahead 4-3 in the ninth this time. Philadelphia reliever Antonio Bastardo struck out the first two batters in the bottom half before Desmond connected on a 1-2 pitch for his fifth homer.

Ryan Zimmerman, who hit a game-ending grand slam on Friday night, started the 10th with a leadoff double against Lidge (0-1). Michael Morse was walked intentionally and Jayson Werth, after striking out three times, singled to load the bases.

Danny Espinosa fanned for the first out. Gomes was 0 for 4 before getting plunked on his left elbow by a 1-0 pitch to win it.

Sean Burnett (4-5), the sixth Washington pitcher, pitched a scoreless 10th.

The win broke a streak of eight straight winning road series by the Phillies.

The Nationals got off to a 2-0 lead in the first off Roy Halladay. Desmond's leadoff double set up Zimmerman's sacrifice fly and Espinosa's run-scoring single, his first RBI since July 17.

Carlos Ruiz homered off Chien-Ming Wang in the second, tying it at 2. Chase Utley's ninth home run put the Phillies ahead 3-2 in the third.

With two outs in the top of the sixth, lightning and heavy rain caused a delay of 1 hour, 11 minutes.

When play resumed, Tom Gorzelanny replaced Wang and faced one batter.

On track for his NL-leading 16th win and fourth this year against Washington before the rain came, Halladay allowed two runs and seven hits in five innings, striking out five and hitting a batter.

After the delay, Halladay was replaced by Michael Schwimer, who made his major league debut. He allowed a home run to Espinosa on the second pitch he threw.

Schwimer pitched three innings and struck out four.

In his fifth start since missing more than two years after shoulder surgery, Wang allowed three runs and five hits. He struck out four and walked one.

NOTES: Phillies SS Jimmy Rollins left in the third inning with a strained right groin. ... Zimmerman has reached base in 27 straight games. ... It was the third long rain delay in the last four games for the Phillies. Thursday's game against Arizona was halted for 2 hours, 17 minutes. The start of Thursday's Reds-Nationals game was also delayed by 30 minutes. ... Philadelphia released RHP Aaron Heilman and OF Jack Cust, who had both recently been signed to minor league contracts. ... LHP Cliff Lee (13-7), who has won four straight games, is scheduled to start Monday night for the Phillies against New York. LHP Jonathon Niese (11-10) will pitch for the Mets. ... LHP Ross Detwiler (1-3) will start Monday for Washington. LHP Joe Saunders (8-10) is scheduled for Arizona.