PHILADELPHIA (AP) -- Given a slim chance, the Phillies found a way to beat the National League's best bullpen.
After all, an unearned run still counts.
Carlos Ruiz hit the go-ahead sacrifice fly in the eighth inning after a Marlins error, and the Philadelphia Phillies beat Florida 3-2 on Sunday.
Ryan Howard began the eighth by reaching on an error by left-fielder Logan Morrison , who was sliding in as the ball ricocheted off his glove. The Marlins were protecting against an extra-base hit, so Morrison was playing more toward left-center field.
Ben Francisco followed with a single off Ryan Webb (0-2), and Raul Ibanez put runners on the corners with a groundout. Ruiz followed with a soft fly to center.
Ryan Madson (1-0) tossed a scoreless eighth after taking over for Cole Hamels , and Jose Contreras , subbing for injured closer Brad Lidge , survived a rocky ninth inning for his third save in as many chances.
"Anytime you win the game, it's good," Phillies manager Charlie Manuel said. "Whether you win ugly or win beautiful, it's positive. It's always positive when you're winning."
Morrison was especially hard on himself for not making the catch.
"It was off the edge of my glove," he said. "I was playing no doubles back in left-center field, so it was a long run, but it's a play that has to be made."
Contreras walked two batters in the ninth and allowed Marlins runners to reach second and third with two outs, but got Omar Infante to ground to third to end the game.
"Those things are going to happen," Manuel said. "His stuff wasn't as quick as usual. He was scuffling, but he needed an out and he got it."
In throwing two scoreless innings, the Marlins actually lowered their league-leading bullpen ERA to 1.89 ERA, though they fell to 4-3 in decisions by allowing the unearned run.
The Phillies jumped ahead with two runs in the first off Anibal Sanchez . Placido Polanco hit a solo homer, a shot that barely reached the right-center field seats. He later singled to make him 7 for 13 against Sanchez. Jimmy Rollins walked, stole second and advanced to third on catcher Buck's throwing error, and Ibanez eventually made it 2-0 with a single up the middle.
"The first inning, the wind helped Polanco for the home run," Sanchez said. "He didn't hit it so hard for that kind of home run. That stuff happens. I made a couple of mistakes in the first inning. I went deep in the count with a lot of hitters and that made me throw a lot of pitches in the six innings."
After Ibanez's single, Sanchez allowed only four more hits through his six innings.
Hamels began by striking out six of the first 10 batters he faced, and the left-hander only surrendered two hits through the first five innings.
"I felt good early, and even later," Hamels said. "I was able to make pitches for the most part."
The Marlins finally broke through in the sixth, when Omar Infante began the inning with a double and Mike Stanton drove him in. Stanton went to third on a single by Gaby Sanchez and later scored on Morrison's sacrifice fly.
"I left a few pitches up," Hamels said. "They have good hitters on that club. I was happy we were able to come away with a win."
A crowd of 45,716 was the second-largest in the regular season in the eight-year history of Citizens Bank Park. It was the 131st consecutive regular-season sellout, and the Phillies improved to 72-26 in Sunday games since the stadium opened in 2004.
NOTES: Phillies RHP Roy Oswalt , who left Friday's game with lower back strain after six innings, is expected to make his next start Thursday in San Diego. He is scheduled to throw a bullpen session Monday. ... Polanco's homer was his first since July 22, 2010, a span of 322 at-bats. ... Marlins INF Donnie Murphy is expected to miss his second straight game with a bruised left knee. He fouled a ball off his kneecap in the ninth inning on Friday and couldn't finish the at-bat. ... Florida will start Josh Johnson after a day off Monday. Ricky Nolasco and Chris Volstad will wrap up the three-game series against the Pirates. ... Gaby Sanchez has reached base safely in all 14 games this season, 18 including last year.