Updated

WASHINGTON (AP) — Ryan Zimmerman's second homer of the game, a shot to center field off Luke Gregerson leading off the bottom of the ninth, lifted the Washington Nationals to a 6-5 victory over the San Diego Padres on Tuesday night.

Zimmerman, trying to secure the final spot on the NL All-Star team in an Internet vote, hit an 0-1 fastball from Gregerson (2-4) over the wall in center. He had earlier homered in the fourth and has three homers in two games and two multiple homer games this season — both against the Padres, who had a three-game winning streak snapped.

Ian Desmond also connected, giving the Nationals their fourth three-homer game of the season.

Matt Capps (3-3) worked the ninth for his third victory in six days. Washington claimed its 10th victory in its last at-bat.

The game-time temperature was 99 degrees, making it the warmest game since the Montreal Expos relocated to Washington, D.C., before the 2005 season.

Michael Morse broke out of a 2-for-22 slump and matched a career-high with three hits for the Nationals, who have won three of five.

Scott Hairston's sacrifice fly put the Padres ahead in the first, but Washington rallied for three runs in the bottom of the inning. With the bases loaded, Ivan Rodriguez hit a hard bouncer off Padres starter Clayton Richard's right foot, tying the game on the infield hit, and Morse slapped a two-run single to center.

In the San Diego third, Adrian Gonzalez snapped a season-worst 0-for-17 skid with an RBI single to make it 3-2.

Zimmerman hit his 15th homer of the year to left with one down in the fourth. Desmond followed an inning later with his fifth homer, a solo shot into the Padres' bullpen in left.

Nationals starter Livan Hernandez departed with a three-run lead after allowing singles to Gonzalez and Scott Hairston to lead off the eighth. Chase Headley singled off reliever Tyler Clippard and Yorvit Torreabla's line drive to left made it 5-3. Aaron Cunningham hit a sacrifice fly to left.

Sean Burnett relieved and Oscar Salazar, batting for pinch-hitter Matt Stairs, hit a grounder to second. Cristian Guzman's shuffle to Desmond at short got one out, but Desmond's relay was wide of first, allowing Headley to score the tying run on his major league-high 21st error.

Hernandez allowed four runs and nine singles in seven-plus innings. Richard yielded five runs and nine hits over six innings.

Desmond atoned in the eighth, when Jerry Hairston Jr. tried to score on Scott Hairston's double to left. Desmond's relay from left fielder Josh Willingham nailed Jerry Hairston Jr. at the plate for the inning's final out.

NOTES: The previous warmest game-time temperature at a Nationals home game was 94 degrees on June 6, 2008. ... Nationals RHP Stephen Strasburg chatted pregame with his former San Diego State coach, Hall of Famer Tony Gwynn, who was in town as part of San Diego's TV broadcast team. ... Desmond's last home run came 31 games ago on May 28, also against Richard.