PHOENIX -- Ahead all night, the Atlanta Braves watched a two-run lead disappear in the ninth inning. A day after losing to Boston on a two-run homer in the ninth, they could have folded.
Instead, the Braves found a way to scratch out a victory and increase their NL East lead.
Dansby Swanson scored the go-ahead run on Yoshihisa Hirano's wild pitch in the 10th inning, and the Braves recovered after blowing a two-run lead in the ninth to beat the Arizona Diamondbacks 7-6 Thursday.
"It speaks to the makeup of that team in there. That's exactly what it speaks to," Atlanta manager Brian Snitker said. "The resiliency, the fight, the grit speaks volumes."
With his team leading 6-4 in the ninth, Snitker brought in Jesse Biddle (5-1), the Braves' seventh pitcher of the night. He couldn't close it out, giving up A.J. Pollock's sacrifice fly and Paul Goldschmidt's solo homer with two outs and two strikes.
Atlanta had a chance for the go-ahead run in the 10th on a single by Tyler Flowers that bounced off shortstop Nick Ahmed's glove, but Swanson stumbled over third base and had to retreat to the bag. The Braves then loaded the bases against Brad Boxberger (2-6) before Hirano uncorked a wild pitch that scored Swanson.
"Different frustrations, the way our lineup battled to get back in it in the ninth inning," Boxberger said. "I just couldn't hold it."
Brad Bach worked around a walk for his first save with Atlanta.
Nick Markakis had four hits and a run-scoring single in the ninth for the Braves, who increased their division lead to 3 1/2 games over Philadelphia.
"That's where the stubborn factor, the competitive factor, comes into play in this game," Swanson said.
Ahmed hit a three-run double for the Diamondbacks, who have lost five of six. Arizona fell 2 1/2 games behind first-place Colorado in the NL West.
"We didn't particularly play our best game today, but when we needed to we rallied around one another," Diamondbacks manager Torey Lovullo said. "We tied the game and unfortunately we couldn't close the deal."
Greinke lost his last start after giving up a pair of late homers to the Los Angeles Dodgers. He got off to a shaky start against the Braves, allowing two runs in the opening inning and Suzuki's two-run homer in the fourth. Camargo hit a solo shot in the sixth to put the Braves up 5-3.
Greinke yielded five runs -- four earned -- and six hits in 5 1/3 innings.
Braves starter Anibal Sanchez breezed through the first three innings, retiring 10 of the first 11 batters he faced. The right-hander ran into trouble in the fourth and Ahmed pulled the Diamondbacks to 4-3 on a bases-loaded double to the corner in left.
Sanchez allowed three runs and four hits in five innings.
SNITKER, SOUZA EJECTED
Both teams had issues with the umpires.
Snitker was ejected with one out in the sixth while on a mound visit to reliever Shane Carle. Snitker talked to Carle, then started arguing about a pitch with plate umpire Mark Ripperger. Snitker was tossed while walking back to the dugout.
Ripperger ejected Souza in the eighth inning after he argued a called third strike.
Arizona acquired INF-OF Patrick Kivlehan from the New York Mets for cash and selected his contract from Triple-A Reno. The Diamondbacks also transferred OF Jarrod Dyson to the 60-day disabled list after a setback in his recovery from a strained right groin.
Braves: Swanson returned to the lineup after being hit in the head by a pitch Tuesday and coming off the bench Wednesday. He went 1 for 4.
Diamondbacks LHP Patrick Corbin (10-5) has allowed three runs or fewer in six straight starts heading into Friday's game against the Braves. He is 3-1 with a 2.35 ERA during that span after tossing five scoreless innings against the Dodgers last time out. RHP Kevin Gausman (9-9) will make his first career appearance against Arizona.
More AP MLB: https://apnews.com/tag/MLB and https://twitter.com/AP-Sports
New Mets infielder Jed Lowrie to have MRI on knee
Jed Lowrie will get an MRI after experiencing pain in the back of his knee while running.
Over/unders, World Series and playoff odds for all 30 MLB teams
The Baltimore Orioles have a season win total of 59.5, while the Yankees are at 96.5. Here are the odds you need to know for all 30 MLB teams.
Stephen A.: Almost no one in sports is worth 10-year deal
Stephen A. Smith has a problem with Manny Machado's 10-year deal with the Padres because he isn't a "box-office" player who can sell himself.
Buster's Buzz: Why Machado signing is a test for Padres ownership
San Diego made a surprising free-agent splash for the second consecutive winter. But can the Padres surround Manny Machado and Eric Hosmer with a championship-level roster?
What does Machado's deal mean for Harper?
Buster Olney sees Manny Machado's $300 million contract as a win for Bryce Harper's free agency.
Stanton glad to play meaningful games 'past May 7th'
Giancarlo Stanton says the biggest difference about coming to New York is playing meaningful games in May and that postseason success is what is driving him.