AP photo by Ben Margot / Atlanta Braves pitcher Max Fried, center, is surrounded by teammates after his pinch hit drove in the winning run of Sunday's 8-7 home victory against the Miami Marlins.

ATLANTA — Max Fried never thought he would have the chance for a game-winning hit in the major leagues. After all, Fried is a pitcher.

Thanks to the Atlanta Braves' depleted bench, his opportunity came Sunday — and Fried delivered.

The pinch-hitting pitcher lined a bases-loaded single up the middle in the 10th inning as the Braves capped their rally for a wild 8-7 victory over the Miami Marlins.

"It's something you always dream about happening," Fried said, "but when I knew I was going to be a pitcher, I figured it would never be reality."

Fried isn't a normal pitcher. The 27-year-old left-hander is hitting .300 this season. He had 11 hits, including four doubles, while driving in four runs in 2019, when he batted .196.

"If Max wasn't pitching, he would be an outfielder in the big leagues," Braves manager Brian Snitker said.

Fried was called on to hit with the Braves out of position players after a four-run rally in the ninth inning. He singled on a 3-1 pitch off Anthony Bass (1-4), driving in Dansby Swanson from third base and drawing his jubilant teammates out of the dugout as they took two of three from a National League East Division foe for the second straight series to wrap up a six-game homestand.

"That was probably as good as I've felt on the field finishing out a game," Fried said.

He surprised Marlins manager Don Mattingly, who assumed the pitcher was hoping for a walk.

"I really was surprised that he swung the bat there, but he's actually a pretty good hitter," Mattingly said.

With the bases loaded and one out in the bottom of the 10th, Austin Riley was thrown out at the plate when he tried to score on a bases-loaded wild pitch by Bass. Riley was initially called safe before the umpires reversed the call on a review.

The Braves quickly recovered from that disappointment. Bass loaded the bases with an intentional walk to Kevan Smith before giving up Fried's single.

Miami opened a 7-3 lead with three runs in the ninth. Sandy Leon led off with a drive to right for his second homer of the season, and Starling Marte singled with two outs and then scored when Jesús Aguilar went deep against Shane Greene for his 13th homer this year.

Marlins closer Yimi García struggled in the bottom half of the inning, though, and the Braves capitalized. Orlando Arcia singled in Dansby Swanson, and Abraham Almonte made it 7-6 with a two-run double. Ronald Acuña Jr. — who had hit a two-run homer off Zach Thompson in the third, his 23rd in 2021 — then delivered a tying sacrifice fly.

García was charged with four runs and four hits. He walked three batters, two intentionally.

"Sometimes you've got those days when you make good pitches and they make good contact, too," Garcia said through a translator.

Will Smith (3-5) pitched the 10th for the win.

Adam Duvall hit a three-run homer and drove in four runs for Miami, and Aguilar finished with three hits and two RBIs.

Duvall, facing his former Atlanta teammates, took the NL lead with 60 RBIs. He also ranks among the NL leaders with 19 homers after his sixth-inning drive off Charlie Morton that gave the Marlins a 4-2 lead.

Duvall just missed another homer in the eighth. His blast to the right-field corner off Chris Martin was initially called a homer by first base umpire John Libka.

After Acuña protested in right, the umpires huddled and called the ball foul. The TV replay confirmed it was foul, and the Marlins did not argue the ruling.

Arcia had two hits in his Atlanta debut. He was primarily an infielder with the Milwaukee Brewers before being traded to the Braves on April 6, but he started in left field Sunday after being recalled from Triple-A Gwinnett. Arcia played only four games in the outfield for Gwinnett.

"I'm open to play anywhere," Arcia said through a translator. "As long as they want me in the lineup, anything I can do to help the team win."

Arcia appeared in one game in center field with the Brewers in 2020.

"I think it's just because we were losing by a lot," said Arcia, who appeared comfortable on defense Sunday, when he raced in to make a sliding catch on pinch-hitter Garrett Cooper's sinking liner in the ninth.

The 26-year-old hit .244 in six seasons with the Brewers. He hit .303 with 13 homers in 51 games with Gwinnett.

Braves left-hander Kyle Muller was optioned to Gwinnett in the move that cleared a spot for Arcia. The Braves, who start a three-game road series against the Pittsburgh Pirates on Monday night, have an open date Thursday. They are expected to carry an extra position player until after the MLB All-Star break the following week, when Muller, who has showed promise as a rookie, could return to the rotation.