PHOENIX -- The series between National League playoff hopefuls Atlanta and Arizona has been a wild ride, and Saturday night's ending might have topped them all.
"He just gave every last bit of energy he had and obviously won the game for us," Braves manager Brian Snitker said.
In the bottom of the inning, with runners at second and third, A.J. Pollock grounded a two-out single up the middle. Steven Souza Jr. scored from third, but Ahmed tried to come around from second and was thrown out by Swanson to end the game.
"A.J. hit the ball and I was going hard and T.P. (third base coach Tony Perezchica) was waving me and it was close," Ahmed said. "I didn't get there."
Swanson said he figured Ahmed would try to score because he would have done the same thing.
"That is just kind of how I would play it offensively. He is scoring no matter what," Swanson said. "I don't think anyone really anticipated that I would be able to catch it and be able to make a throw like that. Honestly, it was the right play on both sides."
Diamondbacks manager Torey Lovullo said he didn't have "a perfect snapshot" of the play but thought it might have been better to hold up at third and give the next batter a chance.
"I feel like there's certain times when you take a little bit of risk and there's other times you don't," he said. "That may not have been the best time to take that type of risk."
The victory boosted Atlanta's lead in the NL East to 3 1/2 games over Philadelphia. Arizona fell 2 1/2 games behind first-place Colorado in the NL West.
Neither team led by more than one run until the 10th.
Souza robbed Kurt Suzuki of at least a double with a leaping grab at the right-field fence, but Inciarte followed with a triple that made it 5-3.
Chad Sabotka (1-0) got the final out in the ninth for his first major league win.
With some difficulty, A.J. Minter picked up his 13th save in 15 tries.
Both teams threatened in the ninth. Swanson tripled off Yoshihisa Hirano with one out but was stranded when pinch-hitter Lucas Duda struck out and, after Ronald Acuna Jr. was intentionally walked, Johan Camargo grounded out.
Arizona, with the help of a throwing error by Camargo at third, loaded the bases with two outs in the bottom of the ninth before Daniel Descalso lined out to center.
Suzuki put the Braves up 3-2 with a two-out solo home run off Jake Diekman in the eighth, but Arizona answered in its half of the inning.
There were four errors in the first two innings, three by Arizona, resulting in a 2-2 deadlock.
Acuna doubled on the game's first pitch and scored when Peralta bobbled Camargo's single to left field. Markakis' sacrifice fly made it 2-0.
The Diamondbacks got an unearned run in the first when Pollock came home from first on Goldschmidt's foul pop to the railing beyond first base. Freeman's throw home came in plenty of time, but Suzuki dropped it.
Arizona tied it 2-all in the second when pitcher Clay Buchholz's two-out double to left-center scored Souza from first. It was the first RBI and extra-base hit in 45 career at-bats for Buchholz.
The Diamondbacks, one of the best defensive teams in baseball, committed four errors.
"The errors we made today weren't typical of what we do here every single day," Lovullo said, "so I just think at times we try to make things happen and we force things and maybe press a play or two and will it to happen, and it doesn't happen."
Braves: RHPs Jose Ramirez and Arodys Vizcaino made rehab appearances for Class A Rome in a playoff game Friday. Ramirez allowed four runs and four hits while getting just one out. Vizcaino tossed a scoreless ninth in a 6-0 loss to Lexington that eliminated Rome.
More AP MLB: https://apnews.com/tag/MLB and https://twitter.com/AP-Sports
MLB to investigate claims of racial discrimination vs. Mariners
MLB said in a statement provided to The Athletic that it will investigate allegations of racial discrimination in the Seattle Mariners organization made by a former employee.
Time for Giants to decide what to do with Madison Bumgarner
Forget nostalgia. With Farhan Zaidi taking over the front office, San Francisco must re-evaluate how the hero of Octobers past fits into the franchise's future.
Phillies manager Gabe Kapler loses Malibu home in Woolsey Fire
Phillies manager Gabe Kapler is thankful his family is safe after his Malibu home was destroyed in the Woolsey Fire that has burned at least 435 buildings and is threatening tens of thousands more.
Japan scores four runs in 9th to beat MLB All-Stars, leads series 3-1
Japan rallied with four runs in the top of the ninth inning to beat the MLB All-Stars 5-3 and take a 3-1 lead in their six-game exhibition series on Tuesday.
Why are baseball managers so short?
In business and politics, taller people tend to make more money and get more votes. Most importantly, they're perceived as better leaders. But not in baseball!
Mauer gives tearful thank you during retirement speech
Joe Mauer gives an emotional thank you to Terry Ryan for drafting him to the Twins back in 2001.