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
NL East Stock Watch: Which team is having the best winter?
The division's four contenders have made the biggest moves to restock their rosters, but they're far from finished.
Giants hire pitching analyst to aid with training efforts
Matt Daniels, the pitching coordinator for Driveline Baseball in Seattle, is joining the San Francisco Giants as ananalyst to aid in the training of the team's pitchers.
How baseball shaped the career of Patrick Mahomes
Chiefs QB Patrick Mahomes and former MLB superstar Alex Rodriguez each tell the story of their relationship and how Mahomes came to choose football.
Five teams ready to strike once Bryce and Manny sign elsewhere
There's more to the market than Bryce Harper and Manny Machado. These clubs could make major upgrades without landing the two biggest prizes.
'I think about his smile, his laugh': Roger Clemens reflects on Mel Stottlemyre
The late great Yankees pitcher and coach battled cancer for decades, but never let on that he was sick.
Former MLB pitcher John Wetteland arrested on child sexual abuse charge
John Wetteland, who pitched for four teams over 12 major league seasons, has been arrested on a charge of sexual abuse of a child under the age of 14, according to police records.