Back when right-hander Williams Perez went on the disabled list, Braves pitched had little margin for error because of the team’s scuffling offense. By the time Perez returned to the mound on Tuesday, the Braves had transformed into a club that, more often than not, provides plenty of run support.

They gave Perez an early lead but he squandered it. The Braves came back to forge a tie, but the Nationals scored the go-ahead run on catcher Tyler Flowers’ throwing error in the eighth inning and went on to a 9-7 victory at Nationals Park.

After sweeping the Padres and Phillies to win six straight, the Braves (54-85) will try to avoid a sweep by the Nationals in Thursday’s series finale. The Nationals (81-57) are 13-2 against the Braves this season.

The Nationals scored the decisive run after Braves reliever Ramirez walked Ryan Zimmerman and Danny Espinosa in the ninth. Pinch hitter Ben Revere put down a bunt that Flowers fielded cleanly, but he threw wildly to third base while trying to get pinch runner Michael A. Taylor.

Taylor scored as the ball sailed into left field.

“It was definitely the right play,” Flowers said. “I was prepared for it. Before Revere got in the box, before the pitch was coming, I knew if I got the ball it was going to be a bang-bang play. Taylor is a good base runner, he’s fast. I saw the secondary (lead) so I knew if I got my hand on it it had to be quick.

“I went through it all in my head and I imagined it being a more accurate (throw) before it happened. It is what it is. It’s a do-or-die play with the game essentially on the line. I tried to be an athlete, it just didn’t work out.”

Trea Turner followed with a two-run single that extended the lead to 9-6. In the ninth inning Nationals closer Mark Melancon gave up a lead-off double to Flowers and Swanson hit an RBI single before pinch hitter A.J. Pierzynski grounded into a double play to end the game.

The Braves came back after Perez blew a 4-1 lead by giving up five runs in the third inning, including two homers. The Braves tied it in the fourth with rookie Dansby Swanson's RBI ground out—his second RBI following his first career homer in the second—and rookie reliever Joel De La Cruz's first career RBI.

The Nationals Perez for eight hits and six runs over 2 1/3 innings to erase a pair of three-run deficits. Perez went on the disabled list June 7 with a strained rotator and couldn’t build on his five scoreless innings in a rehabilitation start for Triple-A Gwinnett on Thursday.

“I think he got narrowed down to the fastball,” Braves interim manager Brian Snitker said. “I think the absence of secondary pitches hurt him as much as anything. He’s only had a couple starts since he came back and we are kind of asking a lot of him right here tonight to do that and he wasn’t real sharp.”

The Braves beat up Nationals left-hander Gio Gonzalez for six earned runs over three-plus innings but the Nationals bullpen stymied them. Seven relievers combined to retire 18 of 20 batters over the final six innings.

The Braves led 2-0 after Ender Inciarte singled and Adonis Garcia doubled in the first inning before scoring on ground outs. Swanson’s inside-the-park homer put the Braves ahead 3-0. After Gonzalez’s RBI single in the second inning, the Braves answered with Freddie Freeman’s run-scoring single in the third.

Staked to that 4-1 lead, Perez fell apart in the bottom of the third.

The Nationals loaded the bases with singles by Jayson Werth, Daniel Murphy and Bryce Harper. Rendon cleared them by smashing Perez’s 0-2 pitch several rows into the left-field seats.

Two batters later Ryan Zimmerman reached down and poked Perez’s first pitch just over the wall in right field for a 6-4 lead. That sent Snitker out to pull Perez, who needed 73 pitches to get through 2 1/3 innings.

“He feels good, so that’s a big thing,” Snitker said. “He didn’t have any problems physically.”

Inciarte extended his hitting streak to 17 games and Freeman is on a 13-game streak.