For three innings it looked as if the Braves were following a familiar script against the Miami Marlins. Score early. Score often. Win.

But on Saturday afternoon the script got flipped. The Braves’ offense took a hiatus for four innings and couldn’t recover at the end, resulting in a 5-4 loss to the Miami Marlins.

The win broke Miami’s seven-game losing streak to the Braves and evened the weekend series. The Braves lost for the second time in 11 games against the Marlins.

It looked positive for the Braves in the first inning when Ronald Acuna hit the first pitch he saw four rows deep into the seats in left-center field for his 21st homer. It was his fifth leadoff homer of the season and the 13th of his career. It also extended his National League-leading streak of reaching base in 16 straight games.

“He’s up there ready, ready to attack,” manager Brian Snitker said. “He got one up and put us up 1-0. Gave us some momentum to score the next run. The guys kind of feed off it.”

That homer was the team’s 141st of the season, the most before the All-Star game in franchise history.

The Braves got another solo homer from Austin Riley in the second inning, his 16th, and led 4-2 after three innings. Riley tied Ryan Klesko for the franchise record for home runs prior to the All-Star game.

That’s when the offense went missing. Suddenly Miami pitcher Caleb Smith (4-4), making his first start since June 8 because of hip inflammation, found the recipe. After allowing four runs on five hits in the first three innings, Smith set down the next nine Braves in order and won for the first time since April 1.

“They’ve got some arms,” Braves catcher Tyler Flowers said. “They’ve got some bats, too. They’re not household names, but I think they will be.”

The Braves had a chance in the eighth against reliever Nick Anderson. With one out, Ozzie Albies ripped his third double of the day off the center-field wall, and went to third on a Freddie Freeman single. But the rally was thwarted when Josh Donaldson rapped into a double play.

Sergio Romo gave the Braves another chance in the ninth. Nick Markakis beat out an infield single to open the inning, but Romo was able to retire the next three hitters and earn his 16th save.

The Marlins took the lead with three runs in the fifth. Jorge Alfaro, who had three hits, drove in a run with a double. Then Yadiel Rivera, who began the day batting .133, put Miami ahead with a two-run single to left.

The damage came against Braves starter Max Fried (9-4), who struggled against a Miami offense that had scored only five runs in the first four games of the current road trip. Fried didn’t have a clean inning among the five he pitched and gave up five runs on a season-high 11 hits, one walk and seven strikeouts. He allowed two home runs.

“Physically I felt good,” Fried said. “I left some balls over the plate. Just wasn’t able to finish today.”

Fried had not allowed a home run in his last three starts. He gave up two long balls Saturday, but seven of his 11 hits were singles.

“I thought his stuff looked pretty good,” Snitker said. “He found the breaking ball toward the end … the fastball had good life. That one pitch to the eighth-place hitter hurt.”