Gaby Sanchez crushed a go-ahead, three-run homer run eighth inning, sending the Marlins past the 4.

Mike Cameron followed Sanchez's shot with his second homer of the night, capping a three-RBI effort for the Marlins, who snapped a three-game losing streak. Greg Dobbs and Mike Stanton also went deep for the victors.

Cole Hamels left with a 4-3 lead after seven solid innings and knocked in a pair of runs for NL East-leading Philadelphia, which had won five straight.

Hamels, in his second start since returning from a short stint on the disabled list, gave up three runs on four hits and three walks in his outing.

Antonio Bastardo (6-1) relieved the lefty in the eighth and was quickly pulled after walking the first two batters. Herndon entered, and after a sacrifice bunt, surrendered a no-doubter to Sanchez, his 18th round-tripper of the year.

"We've struggled, but it's just one of those things where we have to get over it," said Sanchez. "I was lucky enough to get a pitch to do something with."

Cameron immediately reached the left-field seats for his 18th career multi- home run effort, and Dobbs hit a pinch-hit shot two batters later.

Edward Mujica (9-5) earned the win in relief of Ricky Nolasco, who yielded four runs on seven hits over six full frames.

With two outs and runners on the corners in the top of the second, Wilson Valdez poked an opposite-field triple to knock in Ryan Howard and Carlos Ruiz. Hamels grounded one to first and beat out the throw, allowing Valdez to score.

Cameron homered after Sanchez led off the bottom of the frame with a walk, and Stanton's 32nd home run, a moonshot to left, tied things in the third.

"You don't want to make the mistakes like I did because every mistake I made was a homer," Hamels said. "It's tough, especially when you're only up by a little bit. I knew because the game was close I had to keep plugging away and make good pitches."

Hamels shook off the longballs and sent a payoff pitch back up the middle to knock in Ruiz in the fourth.

Game Notes

The game was delayed one hour, 38 minutes due to rain...The Phillies' 7-9 hitters had five of the club's eight hits...Stanton left the game early with tightness in his right hamstring...The Phillies still lead the season series, 10-5.