Chase Utley won it with a two-run homer in the bottom of the 14th.
After a Miami error allowed the Phillies to even the score in the bottom of the seventh, the resurrected bullpen provided seven scoreless innings (one each from Jake Diekman, Jonathan Papelbon, Antonio Bastardo, Ken Giles and Mario Hollands and two from Justin De Fratus) to set the stage for Utley.
The Phillies failed to score with runners at first and second and no outs in the 10th inning and had left seven runners on base through the first four extra innings, but Jimmy Rollins got things going with a leadoff infield single in the 14th. Utley followed by blasting an 0-2 pitch from Chris Hatcher into the right-field seats.
It was Utley's third career walk-off home run and it tied him with Greg Luzinski for sixth on the team's all-time list with 223.
The Phillies needed to salvage a split of this series before playing four more games here this weekend against Atlanta.
Look at the splits on almost every player on the roster and you'll find that being at the ballpark in South Philadelphia has been more a curse than a blessing.
The same holds true for Cole Hamels, although misfortune has accompanied him across the entire country for quite some time now. That said, even the unlucky lefty has been considerably better on the road than he has at home this season.
In six starts on the road, Hamels has a 1.71 earned run average. In seven starts at home, he has a 3.86 ERA.
He pitched well enough to win - doesn't he always? - during the series finale against the Marlins, but was left with a no-decision. It was the 10th straight time Hamels has gone at least seven innings. His ERA is 1.88 in that stretch. His record is 2-2. The team's record is 5-5.
The only thing you could fault Hamels for during his seven innings was his inability to keep the baseball in the park. The Marlins collected six hits off him and three of them were solo home runs. Jarrod Saltalamacchia hit his seventh in the third inning, Giancarlo Stanton slugged his 21st in the fourth and Marcell Ozuna hit his 13th in the seventh. In each case, the home runs opened the inning. It was the most homers allowed by Hamels since Atlanta tagged him for three in a Phillies opening-night loss last season.
Hamels was removed for a pinch-hitter in the bottom of the seventh with his team trailing 3-2, but he at least did not have to absorb an undeserved loss this time. The Phillies evened the score in the seventh when a benched Domonic Brown entered as a pinch-hitter and reached on a single to center field.
Brown later scored the tying run with two outs when Marlins first baseman Jeff Baker botched a routine grounder off Jimmy Rollins' bat.
The Phillies had also scored single runs in the fourth and fifth innings off Marlins righthander Tom Koehler. Three singles and a sacrifice fly by Carlos Ruiz accounted for the run in the fourth and a two-out single by Utley after Ben Revere had stolen second base accounted for the run in the fifth.
That was just the start of a long night that led to some late fireworks.