CHICAGO -- Donnie Murphy homered to cap a four-run rally in the seventh inning and the Chicago Cubs connected four times Wednesday to beat the Miami Marlins 9-7.
Murphy's two-run shot put the Cubs ahead 8-7. Starlin Castro, Dioner Navarro and Ryan Sweeney each added solo home runs for Chicago.
The Cubs avoided a sweep and prevented the Marlins from winning four straight for the first time this season.
Adeiny Hechavarria hit a grand slam for Miami and Logan Morrison had a two-run homer.
Castro and Navarro each homered in the third off Brian Floyd, who allowed three runs in four-plus innings in his major league debut.
Cubs starter Jeff Samardzija took a 3-2 edge into the sixth when he suddenly lost command. Giancarlo Stanton and Justin Ruggiano singled with one out and Morrison walked to load the bases.
Hechavarria, the light-hitting shortstop, hit a 1-0 fastball right down the middle into the bleachers in left-center for a 6-3 lead.
Sweeney homered in the sixth. The Cubs gave away a run in the seventh when Donovan Solano tripled and scored on a throwing error by Navarro when the catcher made a pickoff attempt.
The Marlins led 7-4 when reliever A.J. Ramos entered the game in the seventh and walked the first two batters he faced, Darwin Barney and Anthony Rizzo.
After a passed ball advanced the runners, Navarro hit a dribbler off the end of the bat down the left-field line for a single that scored both runners and made it 7-6.
That was all for Ramos as Ryan Webb (2-6) came on. He didn't fare any better as Murphy hit the first pitch into the left-field bleachers.
The Cubs added an insurance run in the eighth on Castro's double.
Carlos Villanueva (4-8) got the win. Kevin Gregg, despite walking the potential tying runs on base, worked out of a jam for his 29th save in 34 chances.
NOTES: Before the game, the Cubs claimed RHP Daniel Bard off waivers from the Boston Red Sox and selected the contract of RHP Chang-Yong Lim from Triple-A Iowa. Bard, 28, was first-round pick (No. 28 overall) of the Red Sox in 2006 and was one of organization's most highly-regarded prospects at one point. To make room on the 40-man roster, the Cubs designated outfielder Cole Gillespie, who originally was in the lineup Wednesday, and RHP Michael Bowden for assignment. ... Ron Brantly, the Marlins' opening-day catcher before being sent to the minors, is back with the expanded roster and eager for a second chance. "The biggest problem I had at the beginning of the season was I was trying to do too much," he said. ... Both teams are off on Thursday. The Cubs host the Brewers on with LHP Chris Rusin (2-3) taking on RHP Kyle Lohse (9-8), while the Marlins open a home series against the Nationals with RHP Jose Fernandez (10-6) facing a pitcher to be announced by Washington.