Updated

Washington, DC (SportsNetwork.com) - Jayson Werth's RBI single during a six- run sixth inning gave Washington the lead and the Nationals defeated the San Francisco Giants, 14-6, in the rubber match of a three-game set on Sunday.

Bryce Harper and Danny Espinosa both hit two-run homers and Ian Desmond clubbed a solo shot for the Nationals, who erased a 6-2 deficit by scoring 12 unanswered runs.

"They don't quit or stop fighting," Nationals manager Matt Williams said of his team. "I feel its important to continue to apply pressure when we are down."

Craig Stammen (4-4) earned the win and allowed just one run over two innings. Starter Stephen Strasburg was bailed out by his offense after giving up five runs on eight hits across four frames in a sub-par performance.

Gregor Blanco and Travis Ishikawa both homered, while Hunter Pence and Michael Morse each drove in a run for San Francisco, which dropped the final two games of the series.

Jeremy Affeldt (3-2) gave up four runs and five hits, while failing to record an out in the sixth inning. Starter Ryan Vogelsong surrendered three runs on four hits and four walks in 5 1/3 frames.

"We turned it over the bullpen and they've done such a great job," said Giants manager Bruce Bochy. "Give (Washington) credit, they threw out some good at-bats."

Trailing 6-2, Washington used eight hits to take the lead. Desmond homered to left center, chasing Vogelsong from the game. Harper greeted Affeldt with a double to left, moved to third on Asdrubal Cabrera's base hit and scored on a wild pitch.

Jose Lobaton then knocked an RBI single into right and Scott Hairston's liner landed into the left-field corner for a run-scoring double and a tied game. Werth and Adam LaRoche hit consecutive RBI singles later in the inning off Jean Machi to give the Nationals an 8-6 advantage

Denard Span scored Lobaton with a base hit to left off Javier Lopez with two outs in the seventh.

The Nationals continued the scoring in the eighth. Desmond hit an RBI single and Harper and Espinosa each hit two-run homers to account for the final score.

Blanco led off the game by smacking a 3-2 fastball to right-center field for an early Giants lead and Ishikawa opened the second in similar fashion, stroking his second homer of the season to left field for a 2-0 advantage.

The Giants added three more runs in the third. Pence and Buster Posey both singled to start the inning. Pence moved to third on Pablo Sandoval's groundout and came home on Morse's double to center plated Pence, Ishikawa's sacrifice fly scored Posey and Brandon Crawford's grounder up the middle made it a 5-0 game.

Werth provided the Nationals with their first hit of the game to start the fourth and came home on an LaRoche double. Two batters later, LaRoche moved to third on Harper's groundout to the mound before coming home on Cabrera's double to center for a 5-2 score.

Blanco tripled off Stammen to open the sixth and raced home on Pence's sac fly to right.

Game Notes

The Nationals outhit the Giants, 18-12 ... Washington's eight hits in the sixth are the most it has had in an inning this season ... The Nationals won the season series, 5-2 ... Washington is 4-0-1 in season series play against San Francisco since 2011 ... The Nationals are 63-7 this season when scoring four or more runs ... Strasburg now has a career-high 202 strikeouts on the season, but has also allowed a career-high 21 home runs ... Cabrera left the game with soreness in his right side.