ATLANTA -- Marlins ace Jose Fernandez, making the first pinch-hit appearance of his career, drove in the go-ahead run with a two-run double in the 12th inning, helping the Miami Marlins beat the Atlanta Braves 7-5 on Friday night.
The dramatic moment overshadowed the meltdown of closer A.J. Ramos, who blew a rare save in the ninth for Miami. Ramos had converted 33 straight saves, one short of the franchise record, before Tyler Flowers led off with his sixth homer to force a 5-5 tie.
Fernandez, one of baseball's most dynamic starters, began the game with a .222 batting average in 27 at-bats. With the pitcher's spot due up in the 12th and no position players available, Fernandez batted for reliever Nick Wittgren (3-1) and delivered the big hit.
Fernandez is Miami's starter Saturday.
Before the game, Marlins manager Don Mattingly said that Ramos would remain the closer after the team traded for Fernando Rodney. Rodney did his job, facing four batters in a scoreless eighth, but Ramos wasn't as lucky.
Rodney, whose 253 career saves rank fifth on the active list, converted all 17 of his chances this year for the Padres, but Mattingly said the plan was for him to work primarily as a setup man with Miami.
The Marlins snapped a three-game skid and improved to 3-7 against Atlanta, the NL's worst team.
Casey Kelly (0-3), the sixth Atlanta pitcher, took the loss.
Braves ace Julio Teheran began the night having pitched 23 consecutive scoreless innings, but his career-best streak ended quickly when Miami took a 3-0 lead in the first on Derek Dietrich's leadoff homer and Ozuna's 17th homer, a two-run shot.
Teheran avoided trouble in the second when he struck out Yelich to strand the bases loaded, but Yelich chased him in the seventh with an RBI single that made it 3-all.
Teheran allowed 11 hits and five runs and struck out six in 6 2/3 innings. His ERA rose .26 points to 2.72.
Atlanta cut the lead to 3-2 in the second on Erick Aybar's RBI single and Teheran's groundout.
Ozuna's RBI single in the seventh came off Chris Withrow for the go-ahead run.
In his previous 12 starts, Teheran was just 3-5 despite a 1.61 ERA and a .160 opponents' batting average.
Marlins starter Justin Nicolino gave up seven hits, four runs, one walk and struck out one in five innings. The left-hander blew a 3-0 lead when Chase d'Arnaud hit his first career homer, a two-run shot, to put the Braves up 4-0 in the fifth.
Recalled before the game from Triple-A New Orleans, Nicolino has an 8.22 ERA over his last three starts.
Flowers was hit in the hand by a pitch from Wittgren in the 10th. The ball knocked his helmet and glasses off, but Flowers stayed in the game.
Aybar, the Atlanta shortstop, ran into shallow center field to make an over-the-shoulder catch of Adeiny Hechavarria's flyout and doubled up J.T. Realmuto to end the sixth. ... Left fielder Emilio Bonifacio ran a long way to chase down Prado's long flyout in the 11th with a runner on first.
Freddie Freeman reached in the Atlanta 10th when shortstop Adeiny Hechavarria ran into left field and bumped into Christian Yelich. Hechavarria was charged with an error as the ball bounced off Yelich's glove. Atlanta stranded the bases loaded.
Dietrich was hit by a pitch in the second, marking the third time this series and 16th this season, most in the majors. Even the visiting dugout at Turner Field hasn't been a safe place Dietrich, who was hit in the head by Yelich's foul liner on May 29. Carlos Delgado set the Marlins' single-season record after getting hit by 17 pitches in 2005.
Atlanta CF Ender Inciarte strained his right groin and had to leave the game in the sixth inning.
Marlins: RHP Fernandez (10-3) has a 2.15 ERA and a 4-1 in seven career starts against Atlanta.
Braves: Snitker wasn't sure who will start on Saturday.