MIAMI (AP) Justin Bour found a way to end the Miami Marlins' flurry of double-play grounders Wednesday night - by hitting the ball over the fence.
Bour whacked a game-winning three-run homer with no outs in the ninth inning, and Miami rallied past the San Francisco Giants 6-5.
The Marlins won despite hitting into a franchise record-tying five double plays, including one on a grounder by Bour.
''Really frustrating,'' he said. ''But you've got to keep battling.''
The Marlins trailed 5-3 to start the ninth, and rallied against Santiago Casilla (4-2), who blew a save for the fourth time in 24 chances.
The comeback took 11 pitches. Christian Yelich led off with a single, Adeiny Hechavarria singled, and Bour pulled a 1-0 sinker over the fence in right field for his eighth homer and first career walk-off homer.
Bour was greeted by a cluster of teammates and was doused with a sports drink as he crossed the plate.
''My jersey is soaked and might be ruined,'' he said. ''But I'd do it again tomorrow.''
The Marlins had been 0-38 when trailing after seven innings. Now they will go for a three-game sweep of the reigning World Series champions, with ace Jose Fernandez returning Thursday from a layoff of more than a year following Tommy John surgery.
''It'll be a huge day for us with Jose coming back,'' manager Dan Jennings said.
Steve Cishek (2-5) pitched a scoreless ninth for the Marlins, who won despite being out-hit 14-8. They squandered a 3-1 lead and committed a season-high three errors, which led to two unearned runs.
''We were a little sloppy defensively, which is uncharacteristic for this ballclub,'' Jennings said. ''But you can throw it out the window.''
The comeback cost Florida native Chris Heston his ninth victory. Heston, pitching before more than 20 friends and relatives, went six innings for the Giants and allowed three runs, all in the third.
San Francisco's five double plays matched the team record for a nine-inning game, achieved six other times. Shortstop Brandon Crawford homered and had a hand in all five DPs.
''We played great, did a lot of good things, come back to take the lead, and unfortunately, it's baseball,'' manager Bruce Bochy said. ''The closer was off tonight, and that's the difference in the game.''
Miami starter Dan Haren allowed 10 hits and four runs, three earned, in 5 2-3 innings. He fared better at the plate, crossing up the Giants in the Marlins' three-run third inning when he faked a bunt on a 2-2 pitch and instead swung and singled past the first baseman to drive in a run.
With the defense charging, Haren made the decision to swing rather than bunt, Jennings said.
''He read it,'' Jennings said. ''That's the crafty veteran he is.''
Miami's Dee Gordon, who hit a three-run inside-the-park homer Tuesday, this time stopped at third with an RBI triple. He extended his hitting streak to 12 games.
Giants: C Buster Posey left the game in the sixth inning after he took a foul ball off the mask in the fourth. He passed a concussion test and said he hoped to play Thursday. ... RHP Tim Hudson left the team to deal with a personal issue. He is bothered by a sore shoulder and might go on the DL. ... OF Hunter Pence (wrist) will likely play in a couple of rehab games and probably won't rejoin the Giants until after the All-Star break, Bochy said.
The series finale Thursday matches two pitchers making their 2014 debut - Fernandez and Matt Cain. Both are coming back from elbow injuries that sidelined them last season. Fernandez is 12-0 with a 1.09 ERA in 20 career starts at Marlins Park.