Eight outs from being swept for the first time all season, the Braves got down and dirty Sunday.

Just as a steady rain started falling at Turner Field, they rallied for three runs off Dodgers ace Clayton Kershaw, turning an error, a wild pitch and a broken-bat bloop into a tie game. Two innings later, Martin Prado gave the Braves a 4-3 victory with a walk-off RBI single.

A little celebratory water-dousing from teammates rushing out of the dugout was redundant for the Braves’ favorite target, who was already wet and onto their ways from his last walk-off hit Aug. 16 against the Giants.

“A great at-bat,” said Chipper Jones, who watched it from first base after his intentional walk in the ninth. “Probably Prado’s best at-bat in a couple weeks.”

As much as he’s struggled by his own standards this season, Prado dug in when it counted. He fought Dodgers’ reliever Blake Hawksworth for seven pitches before lacing a 3-2 change-up into left field to score Jose Constanza, who led off the ninth with an opposite-field single and took second on a wild pitch.

“I’ve been thinking too much at home plate, and I lost my swing for some reason,” Prado said. “I’ve been trying to get it back. That’s one of those at-bats that gives me some confidence. I’m going to try to keep working and get my swing back before we get to the playoffs.”

The Braves’ 23rd win in their final at-bat this season left them in good position to make the playoffs with 23 games left in the regular season. Both the Phillies and Cardinals lost Sunday, so the Braves headed to Philadelphia with their deficit in the NL East down to 7 1/2 games and their lead in the wild card up to 8 1/2 games. Their magic number to clinch the wild card is 15.

“It was big for us not to go into Philly having lost three straight. ... We know we’ve got to go in and take care of business against them, but [this was] one of the biggest wins of the year, I’ll tell you that,” Jones said. “Wins like that are always momentum builders.”

The Dodgers opened up a 3-0 lead on one swing, when Matt Kemp sent a hanging change-up into the left-field seats in the third inning off Randall Delgado. With first base open, Braves manager Fredi Gonzalez chose not to intentionally walk Kemp, like he did four other times in the series, and put the rookie Delgado in a bases-loaded situation, especially that early in the game.

But the later it got, with that 3-0 lead holding, the bigger the decision weighed on Gonzalez’s mind. “Nobody second-guesses themselves more than I do, even my wins,” Gonzalez said, laughing. “I guess my wife does.”

Alex Gonzalez and Jack Wilson collected back-to-back hits with one out in the seventh to give Gonzalez other decisions to think about.

Constanza created an opening with a hard-hit grounder to the left side that third baseman Aaron Miles collected and fired quickly and off line to second baseman Justin Sellers, rushing for an inning-ending double play. A run scored on the error, and Constanza and Wilson moved into scoring position on a wild pitch for Conrad.

With the count 3-2, Conrad muscled a broken-bat single into center field to tie the game 3-3. He willed it to fall in as he ran to first base, not looking where he was going.

Conrad sprained his right ankle on the play, in keeping with the ugly but effective theme.

“Everybody got a few laughs out of it and I did, too,” said Conrad, wearing an air cast after the game (he’ll be re-evaluated Monday in Philadelphia). “You figure you get a base hit, you’re able to run down to first base and not sprain your ankle. But we tied up the game, and Prado came up huge for us.”