Atlanta, GA (SportsNetwork.com) - Dan Uggla delivered a blast to beat his old team.

This was some slump-buster.

Uggla hit a three-run homer in the top of the ninth inning and the Washington Nationals snapped a six-game losing streak with an improbable 13-12 win over the Atlanta Braves on Tuesday in a game they trailed 9-1 after two innings.

Uggla's go-ahead blast off Braves closer Jason Grilli was his first homer as a National and one of 32 combined hits in the game between the NL East rivals. He knocked in five runs.

"We were done so much and we kept coming back," Uggla said. "This ball park is a pretty special place to me."

The Nationals won despite trailing by eight runs entering the third inning after right-hander A.J. Cole was knocked around in his major league debut.

Denard Span had a career high-tying five hits, including a solo home run that knocked Braves starter Julio Teheran out of the game in the sixth inning.

"At the end, you can see that it was a bad outing," Teheran said. "This is one bad game."

Span, who scored four times, led off three different innings with hits. Jose Lobaton added a three-run blast in the victory.

Washington lost the opener of the three-game series 8-4 on Monday night for its longest losing streak in almost two years. Tuesday's win marked the Nats' biggest comeback since moving from Montreal to Washington in 2005.

Freddie Freeman and A.J. Pierzynski fueled Atlanta's offense with four hits apiece. Freeman scored three times and Pierzynski drove in four runs.

Cole filled in for injured ace Max Scherzer and lasted two innings, giving up nine runs -- only four of them earned -- on nine hits. The 23-year-old was called up from Triple-A Syracuse to replace Scherzer, who suffered a sprained thumb during an at-bat last week.

The Nationals pulled within 11-10 after a three-run seventh inning highlighted by Uggla's two-run triple. Freeman singled in the bottom of the seventh for his first four-hit game since July 2013 and Pierzynski added an RBI single to make it 12-10, his first four-hit game since August 2013.

Grilli (0-1) struck out Ryan Zimmerman to start the ninth, but Lobaton singled and Danny Espinosa walked to set the stage for Uggla, who played for Atlanta from 2011 until he was released last July.

He homered into the left-field seats on a 93 mph fastball that Grilli left over the plate on an 0-2 count.

Span stroked a two-out double over Jonny Gomes' head in left field for his fourth career five-hit game and Drew Storen stranded a runner in the bottom of the ninth for his fifth save of the season.

Andrelton Simmons delivered a two-run single in Atlanta's seven-run second inning after Cole intentionally walked Nick Markakis to load the bases.

Two runs scored on Cole's error in the inning -- he didn't catch Zimmerman's toss while covering first base -- and Kelly Johnson followed with a two-run double. Jace Peterson's RBI single gave the Braves a 9-2 lead.

Lobaton belted a three-run homer to left-center field to cap a four-run fifth inning that drew the Nationals within 10-6.

Span stroked his first homer of the season with two outs in the sixth.

Pierzynski knocked in Freeman for the second time in the game in the bottom of the sixth with a double to make it 11-7.

Game Notes

Teheran gave up seven runs -- three earned -- on 10 hits in 5 2/3 innings ... Blake Treinen (1-2) threw two innings to earn the win for Washington ... To make room for Cole, the Nationals optioned right-hander Rafael Martin to Syracuse ... Tanner Roark pitched three innings, more than anyone else for the Nationals. He gave up two runs, six hits and a walk.