BOSTON -- The Boston Red Sox avoided their first four-game losing streak of the season -- barely.
J.D. Martinez scored when Marlins shortstop JT Riddle threw away a potential double-play ball in the ninth inning, lifting Boston over Miami 8-7 on Tuesday night following a wild, back-and-forth final two innings.
"It was pretty amazing that we were able to pull off a win tonight," said Jackie Bradley Jr., who had two hits and two RBI. "I don't believe in ugly wins. I believe in wins. As long as we continue to win, I don't care how ugly it is."
Miami scored five runs in the eighth inning to lead 6-4, allowed three runs to Boston in the bottom of the inning, then tied the game at 7 in the top of the ninth against closer Craig Kimbrel (4-1).
"We didn't pitch well of the last third of the game, but we swung the bats well and we ended up winning," manager Alex Cora said. "We took advantage of their mistakes."
Martinez started the final rally on a one-out single and went to second on Xander Bogaerts' hit.
"It's a two hopper -- step on the bag and throw the ball to first. As simple as that," Riddle said. "I throw the ball 80 feet and lose the game."
Drew Steckenrider (4-3) was stuck with the loss.
Nunez homered in the sixth to put Boston ahead 4-1, a lead that held until Matt Barnes' melted down in the eighth. Realmuto and Starlin Castro hit back-to-back home runs during the five-run inning, which also included a two-run single by Rafael Ortega.
"Obviously the ending was not very good, but it was kind of the way we played all night," Marlins manager Don Mattingly said.
Before batting around in the eighth, Miami's only score came on Isaac Galloway's solo homer in the third.
With two starters out of the rotation because of injuries, Boston's bullpen has been pushed lately and the wear has shown during the recent slide. After Barnes' implosion in the eighth, Kimbrel struggled in the ninth with two walks before allowing Magneuris Sierra's tying single.
"If we're going to be a successful team we're going to have to turn it around and we know that," Kimbrel said. "This is the team that we have and this is the team that we're going to make a run with, so we've got to figure it out or we're not going to win. I've got a pretty good feeling we're going to figure it out."
WELCOME BACK JOSE
Jose Urena returned to Miami after a six-game suspension and allowed four runs and six hits and struck out two in six innings. Urena, suspended for hitting Atlanta's Ronald Acuna Jr. with a pitch on Aug. 15, didn't figure in the decision.
Marlins: OF Garrett Cooper will have surgery Friday in Miami to repair a tendon sheath in his right wrist, Mattingly said.
Red Sox: LHP Eduardo Rodriguez (right ankle sprain) will return from the DL and start Saturday when the Red Sox visit the Chicago White Sox. Cora said Rodriguez's return will take some pressure off the starting rotation as well as the bullpen. ... LHP Chris Sale (left shoulder inflammation) played catch Monday, which Cora described as a "good start" but didn't offer a timetable for his return.
More AP MLB: https://apnews.com/tag/MLB and https://twitter.com/AP-Sports
Even when your playoff odds drop to absolute zero, there's still a chance to do something absolutely special on the diamond.
The Phillies get the Braves in Philadelphia for three games to end the regular season, but it may not matter after the teams' four-game series at SunTrust Park starting Thursday night.
Hurricane Maria was a death knell for a 70-year-old stadium in Caguas that saw more than a dozen MLB Hall of Famers play. Red Sox skipper Alex Cora on the demolition: 'The press box was my crib, my playpen.'
The Washington Nationals begin their final homestand of the season Thursday night when they host the New York Mets.
A congressional subcommittee will review the landscape in the aftermath of a Supreme Court decision that opened a path for states to offer legal sports betting.
The 24-year-old righty is pitching so well after Tommy John surgery, L.A. no longer needs to treat him with kid gloves.