Chris Johnson and the Braves came back to beat the Pirates on Tuesday, 5-4, in 10 innings.

ATLANTA -- This time, Andrelton Simmons was the hero as the Atlanta Braves collected their eighth final at-bat victory of the season and second in four days.

Simmons doubled with two on and one out in the 10th inning for his first career walk-off hit to give the Braves a 5-4 win over the Pittsburgh Pirates on Tuesday night.

"I came into the game not feeling 100 percent confident," the young shortstop said. "But I battled through it and ended up with three hits and the game winner. Pretty cool."

The Braves (36-22) are 6-2 in extra innings and lead the National League East by seven games. They defeated second-place Washington on B.J. Upton's 10th-inning hit on Saturday.

Pittsburgh's Mark Melancon walked Dan Uggla leading off the 10th inning and then plunked pinch-hitter Reed Johnson with one out.

"That put me behind the eight-ball," Melancon said.

Up came Simmons, who has a 10-game hitting streak, but had grounded out to end the eighth inning with the bases loaded. This time he came through with a ground-rule double to right-center field.

"I couldn't have asked for anything better than to get my first walk-off hit here," he said.

"Fast ball, missed location," Melancon said of the pitch. "I kept missing down and away."

B.J. Upton tied the score against the Pirates with a two-run homer in the sixth and four relievers kept it that way until Simmons' clutch hit.

"Every loss stinks," Melancon said.

Atlanta had plenty of opportunities to win the game without going to extra innings. The Braves stranded a runner at third in the seventh, had the bases loaded in the eighth and left two on in the ninth.

The Braves bullpen, though, worked four scoreless innings, allowing just one hit and one walk. Anthony Varvaro, who pitched a perfect top of the 10th, was credited with the victory.

Gaby Sanchez and Pedro Alvarez homered for Pittsburgh, but it was all for naught as the Pirates (35-24) lost for the fourth time in five games.

Pirates starter Jeff Locke was pulled after giving up a two-out single to Uggla in the sixth and the Braves quickly tied the score against reliever Ryan Reid, making his second major-league appearance.

Upton went down and got a 1-2 fastball and sent a line shot over the center-field fence for his sixth homer of the season and second in three days.

Locke, who was bidding for his sixth victory in a row, was charged with three runs. He allowed six hits, walked two and struck out seven. Of his 103 pitches, 61 were strikes.

Only two of the four runs were earned off Braves starter Mike Minor, who had gone 4-0 with a 1.98 ERA in May. He gave up four hits, walked none and struck out six, throwing 66 of his 94 pitches for strikes.

After pulling a drive with home-run distance just foul leading off the second, Sanchez connected again two pitches later. Minor missed his target with a 2-2 fastball and the Pirates first baseman sent a blast over the fence in left-center field.

"Usually once that happens, you don't get another chance," said Sanchez, who has hit all five of homers while batting cleanup.

Then the Pirates took advantage of an error by Uggla at second in the third inning to go up 3-0. Jordy Mercer, starting at second base for Neil Walker, doubled with two outs and Andrew McCutchen followed with a double of his own to drive in two runs.

The Braves, though, snapped Locke's scoreless streak at 22 innings with two outs in the third. After a walk and single, Freddie Freeman reached out and slapped a flare just past third base that hit the chalk and rolled into the corner for a two-run double.

Minor was the first left-handed starter the Pirates had faced since May 18 and manager Clint Hurdle got as many right-handed hitters into the lineup as he could, even starting catcher Russell Martin in right field.

Alvarez, the Pirates' only left-handed hitting starter, pushed the lead to 4-2 in the fourth. He went the other way with a 0-2 pitch from Minor that caught too much of the plate and sent his 12th homer of the season into the left-center seats.

"Trying to pound the strike zone doesn't always work out for you," Minor said. "I should have buried a couple of those pitches."

NOTES: Braves LF Justin Upton was second behind Giants C Buster Posey in the first National League fan voting results announced Tuesday for the July 16 All-Star Game. Upton was picked as a reserve in 2009 and 2011 while playing for Arizona. ... McCutcheon was seventh in the outfield voting. He made the NL team as a reserve the past two seasons. ... The series concludes with a 12:10 p.m. game Wednesday. LHP Wandy Rodriguez (6-3, 3.47 ERA) will start for the Pirates against RHP Julio Teheran (3-2, 3.71). ... The Pirates won the last three games of a four-game series against the Braves at Pittsburgh in April.