Automatic runner Romy Gonzalez scored a go-ahead run on David Hamilton’s RBI groundout in the 12th inning, Tyler O’Neill added an RBI double and the Boston Red Sox beat the Miami Marlins 6-5 on Thursday for a sweep of the three-game series.

Gonzalez advanced to third on Ceddanne Rafaela’s single against Matt Andriese (0-1) and then raced home on Hamilton’s grounder to third. O’Neill followed with a shot to the warning track in center field that scored Rafaela.

Red Sox starter Nick Pivetta took a no-hit bid into the seventh inning. It was broken up by a two-out triple from Jesús Sánchez, who missed the cycle by a single.

Zack Kelly (3-1) threw two innings of relief. Greg Weissert closed, holding the Marlins to Jonah Bride’s sacrifice fly in the 12th for his first major league save.

The Red Sox squandered two leads before securing their fifth road sweep this season.

“We did a good job, they did a good job,” Red Sox manager Alex Cora said. “Baserunning today was outstanding. We grind with them and never stopped playing.”

Run scoring singles from O’Neill and Enmanuel Valdez in the top of the 11th put the Red Sox ahead 4-2. But Sánchez tied it in the bottom half with a two-run homer on the first pitch by Kelly.

“It’s an extremely hard sport to play. Guys get on base,” Pivetta said. “Sanchez — he took a good swing on a fastball and hats off to him. I think more important today is that we pulled off a win as a team and I think that was really good.”

After Sánchez’s triple off the wall in center, Pivetta ended his outing by striking out Jake Burger. Pivetta walked two and struck out 10, matching his longest start of the season.

“He was really good,” Cora said. “Pounding the strike zone, had a good fastball. The sweeper was good. He was in command. Gave us what we needed.”

Rafael Devers drove in two runs and had three walks while Hamilton singled, walked and stole two bases for the Red Sox, who won their fourth straight.

Boston’s Connor Wong went 0 for 2, ending his hitting streak at 17.

Burger struck out five times and became the third Marlins player to do that in a game.

The Marlins had a chance to win it in the ninth but Red Sox center fielder Jarren Duran threw Sánchez out at the plate as he attempted to score from second on Xavier Edwards’ single. The throw and catcher Reese McGuire’s tag at the plate prevented the Marlins from their ninth walk-off this season.

“I just tried to make sure to stay smooth to the ball and not try to rush it too much,” Duran said. “I knew that if I put a good throw on it that I was going to have a chance to get him.”

The Marlins unsuccessfully challenged that McGuire blocked Sánchez’s path to the plate.

“If he was not blocking the plate there, I could have had more possibility to make it and score,” Sánchez said. “It’s part of the game. We didn’t feel frustration because we understand the game, but you’ve got to keep going and try to win the game and that’s our mentality.”

Kyle Tyler limited Boston to two runs and three hits over 5 1/3 innings. In his third major league start, Tyler walked three and struck out three.

“It was a good come from behind – I wish I could say win – but a really good comeback,” Marlins manager Skip Schumaker said. “Fun baseball game. Just unfortunate we couldn’t come away with the win.”

TRAINER’S ROOM

Marlins: Placed INF Otto López (lower back inflammation) on the 10-day injured list and recalled Bride from Triple-A Jacksonville. ... Optioned RHP Anthony Maldonado to Jacksonville and selected Andriese from the same minor league club.

UP NEXT

Red Sox: RHP Tanner Houck (7-6, 2.67) will start Friday, when the Red Sox open a three-game road series against the New York Yankees. LHP Nestor Cortes (4-7, 3.51) will start for New York.

Marlins: RHP Bryan Hoeing (0-0, 1.83) will start the opener of their three-game home series against the Chicago White Sox on Friday. RHP Drew Thorpe (2-1, 4.43) will go for the White Sox.

More From 92.9 The Ticket