MIAMI -- It was a much-needed win for the San Francisco Giants, but it came at a great cost.
Pablo Sandoval's tie-breaking two-run single in the 16th inning lifted the Giants past the Miami Marlins 6-3 on Thursday, but the Giants also lost third baseman Evan Longoria to a broken left hand after he was hit by a pitch.
"A great win, but a tough loss," Giants manager Bruce Bochy said.
Longoria sustained a fracture to his fifth metacarpal, which could require surgery. A decision is expected in the next couple of days.
"Obviously the goal is to decide something as soon as possible and then get going in the right direction, whether that's put a cast on it and just let it sit or have some sort of surgery and go that route," Longoria said.
Longoria initially stayed in the game to run after he was hit in the fourth inning, but came out in between innings.
"It wasn't my legs," Longoria said. "I just hate coming out of the game right away. I've always thought it looked bad. I knew right away that it didn't feel right, but I just figured I could run and in the meanwhile let (Alen Hanson) get loose and come into the game."
Longoria is hitting .246 with 10 home runs and 34 RBI in 67 games.
"It's a tough loss," Sandoval said. "I don't know how many days he's going to be out, but we're going to miss the guy. He's a great hitter, great defensive player, and a great teammate. I hope he recovers well and comes back to help us get to the postseason."
Andrew McCutchen hit a two-run homer to continue his torrid month and Mac Williamson also homered for the Giants, who salvaged the final game of a four-game series and beat the Marlins for only the second time in the last 10 meetings.
"It was a great win to head home on after a tough series," Bochy said. "I'm looking forward to getting out of Miami, trust me."
Giants' starter Dereck Rodriguez pitched 6 2/3 innings, allowing two runs with his father and former Marlins' World Series championship catcher Pudge Rodriguez sitting behind home plate. Ty Blach (4-5) also pitched 6 2/3 innings for the Giants without allowing a run. He gave up seven hits, walked two, and struck out three.
"Two quality starts in one game. I'll take it," Rodriguez said.
Sam Dyson came on for Blach to get the final out with two runners on for his first save of the season.
McCutchen started the 16th with a single, Brandon Crawford walked and Alen Hanson singled to load the bases of Elieser Hernandez (0-4). Sandoval's single to center made it 5-3, and Gorkys Hernandez added a sacrifice fly later in the inning. The runs were the first for the Giants since the second.
"I just tried to calm down -- everyone was tired -- and tried not to do too much," Sandoval said.
Miami had two runners on in the bottom of the 16th for Bryan Holaday, who flew out to end the game.
"Epic game," Bochy said.
It was the longest game of the season for the Giants and the second-longest for the Marlins, who went 17 innings in a 2-1 win over the Chicago Cubs on March 30.
Both teams had opportunities in extra innings after the Marlins tied the game in the bottom of the ninth off Hunter Strickland on a sacrifice fly by Lewis Brinson. Second baseman Joe Panik was unable to hold onto a pop up near the foul line, allowing the lead-off runner to reach.
It was the eighth time in the series the Marlins came back to tie the game.
"It was one of those series where you kind of play back and forth," Marlins manager Don Mattingly said. "Close games. Good for a lot of situations."
The Giants looked to take the lead in the 11th on a double by Hanson, but Crawford was thrown out at the plate.
Miami threatened in the 13th when Bochy ordered an intentional walk to Starlin Castro load the bases with two outs and Hernandez due to bat because the Marlins were out of position players. Hernandez bounced out to Blach.
"With Castro up there, that was an easy one," Bochy said. "I wasn't going to let him beat us there. We were in a pretty good situation there."
The Marlins had another opportunity in the 15th with runners on the corners and one out, but Justin Bour grounded into a double play. Bour slammed his helmet to the ground in disgust.
"I saw it off the bat and I thought we might have a chance," Blach said.
McCutchen hit a two-run homer in the first inning for the second straight game. Five of his eight home runs have been this month. He went 3 for 7 to raise his batting average to .339 (19 for 56) in June, historically the best month of his career. He has 11 multi-hit performances in his last 18 games.
Williamson's fourth home run of the season gave the Giants a 3-0 lead against Dan Straily in the second inning.
JT Riddle's solo shot, his third, cut the deficit to 3-1 in the fifth.
Holaday's two-out base hit to left pulled Miami within 3-2 in the seventh, ending Rodriguez's outing.
"It's really good to see everyone in this room just continues to keep working toward every single at-bat, getting a hit, getting a hit, just no one giving into anything, everyone scratching and clawing through every single pitch," Straily said.
Rodriguez scattered seven hits and struck out four in his third start.
SMITH EXPECTED TO GO ON BEREAVEMENT LIST
Miami's Caleb Smith was not with the club due to a funeral and is expected to go on the bereavement list. Mattingly said Smith will make his next scheduled start at San Francisco on June 18.
HOLADAY'S STREAK CONTINUES
Holaday threw out Mac Williamson trying to steal second base in the fourth inning. It was the ninth consecutive base stealer Holaday has thrown out, extending his franchise record. The nine straight is the most in the majors since Arizona's Miguel Montero threw out nine in a row in 2011.
Marlins: RHP Brett Graves (left oblique) is nearing a return and the plan is for him to begin out of the bullpen.
Marlins: RHP Jose Urena (1-8, 4.59) begins a three-game series at Baltimore on Friday.
More AP baseball: https://apnews.com/tag/MLBbaseball
Forget Babe Ruth, Yankees get the guy who could strike him out
Adding Adam Ottavino -- who boasted he'd whiff the Bambino "every time" -- gives the Bombers the best bullpen in the universe.
Could these 'mystery teams' be in on Manny Machado, Bryce Harper?
Are the Yankees set to swoop in on Manny after all? Who might be biding their time for Bryce? We look at some of the potential surprise suitors insiders are talking about.
'I came up on one-year deals': How Joe Maddon is approaching 2019
As the skipper enters his potential final year in Chicago, Maddon is leaving no stone unturned as he tries to get the Cubs back on track after a disappointing finish and a quiet offseason.
Will Bryce Harper and Manny Machado sign before Super Bowl Sunday and other burning questions
With the offseason providing few answers for baseball's superstar free agents, we shed some light on where things stand and where they're headed.
Tim Tebow will report to major league camp for Mets in February
The Mets say Tim Tebow will return to start spring training at the team's major league camp in Port St. Lucie, Florida.
Red Sox unlikely to spend big to sign closer, Dave Dombrowski says
Red Sox president Dave Dombrowski said Thursday he doesn't expect to spend a lot of money on a closer.