The Phillies lost the first two games of the series to the last-place Nationals but managed to avoid their first sweep against Washington.
Wilson Valdez led off the 11th with a bunt single against Collin Balester (0-1) and was sacrificed to second by pinch-hitter Roy Oswalt, the ace pitcher acquired Thursday in a trade with Houston. Valdez went to third on a fly ball by Jimmy Rollins and scored on Polanco's third hit, a single to center.
Werth followed with an RBI double.
Jose Contreras (6-3) pitched a scoreless 10th inning for the win. Brad Lidge, who allowed a game-ending, three-run homer to Ryan Zimmerman on Saturday night, worked the 11th for his 11th save in 15 opportunities.
The Phillies came into Washington with an eight-game winning streak. They won the finale, but still left battered and bruised. First baseman Ryan Howard left with a sprained left ankle in the first inning and left fielder Raul Ibanez missed the game with a sore left wrist. Two other mainstays from the two-time NL champs, Chase Utley (sprained right thumb) and Shane Victorino (abdominal strain), are on the disabled list.
Philadelphia took a 2-0 lead in the first off John Lannan. With two outs, Werth doubled and Howard was hit by a pitch. Ben Francisco singled to right and, after Werth scored, Howard scrambled back to second and twisted his ankle. He had to be helped off the field and was replaced by Cody Ransom, who scored on Domonic Brown's single.
Howard, in an 0-for-14 slump, sat out his first game of the season on Saturday night.
Lannan, who is 0-7 against the Phillies, was recalled from Double-A Harrisburg to start in place of injured rookie Steven Strasburg. The left-hander allowed two runs and seven hits in five innings. He was 2-5 before being sent down on June 21.
Washington tied the score at 2 in the fourth. Cole Hamels hit Roger Bernadina with a pitch to start the innings and Ian Desmond doubled Bernadina to third. With one out, Zimmerman doubled to right to score two runs.
Adam Dunn hit a two-run homer off Hamels in the sixth to give Washington a 4-2 lead. Before the home run, Dunn was 1 for 17 against Hamels.
Hamels has won just once in his last nine starts. He allowed four runs and six hits in seven innings and tied his season high with 10 strikeouts. He did not walk a batter.
In the seventh, Philadelphia tied the score on an RBI double by Polanco and an infield out by Francisco.
NOTES: Washington RHP Tyler Walker had surgery on his right shoulder Friday. He will miss the rest of the season. ... Philadelphia pulled off a double steal in the first inning. Brown stole second - his first stolen base. The Phillies have stolen third 10 times this season. ... Desmond made two errors at shortstop. He's made a major league-leading 26. ... Oswalt and Washington RHP Livan Hernandez were both used as pinch-hitters. ... Philadelphia hasn't been swept against the Nationals franchise since dropping four straight games in Montreal from Aug. 25-28, 2003.