PITTSBURGH -- Cole Hamels leads the major leagues in losses, but he hasn't lost his sense of humor.
Of course, it is easy to joke after a win and Hamels couldn't help but note that fellow Philadelphia Phillies left-hander Cliff Lee did not win his first game until July 4 last year.
"I've got three on the Fourth of July," Hamels said. "I'm ahead of Cliff's pace."
Hamels pitched seven innings for just his third win of the season and his teammates pounded out 14 hits as the Phillies beat the Pittsburgh Pirates 6-4 at PNC Park.
It was a rare win for Hamels (3-11), who came into Independence Day leading the major leagues in losses. It was a rare show of run support for the southpaw as the Phillies have scored just 22 runs in his 11 losses.
Hamels held the Pirates (52-32), who have the best record in the majors, to two runs -- one earned -- and seven hits in seven innings. He struck out eight and allowed no walks.
"It was being able to get back to what I know, which is establish the strike zone early then throw all my pitches," Hamels said. "Ultimately, it was staying down in the zone. That's where I've got hurt in the past, I get guys where I want them and not able to finish them off because I'm getting too many balls up in the zone."
Phillies manager Charlie Manuel particularly liked Hamels' command.
"He got the win and he didn't have any walks, so that's real good," Manuel said. "He went seven innings, too. It was a real good day for Hamels."
The Phillies (41-45) avoided falling to a season-worst six games below .500 with just their 10th win in their past 25 games. They also won a series at PNC Park for the first time since 2008.
Pittsburgh lost for the second time in three games since a nine-game winning streak.
Ben Revere had three hits and two RBIs for Philadelphia. The Phillies tallied 14 hits, including two each by Chase Utley, Jimmy Rollins, Delmon Young and Carlos Ruiz.
"It's not so much the raw number of hits you have but what you get them," Young said. "We were playing the best team in baseball with the Pirates. Their pitching has been outstanding and their offense has been lagging but they're winning because they hit in the clutch. That's what we did today, and what we need to continue to do."
Ruiz had the big hit, a two-run single during a four-run sixth inning that put the Phillies up 5-2.
Jonathan Papelbon pitched a scoreless ninth inning for his 17th save.
Gerrit Cole (4-1) suffered his first major-league loss after winning his first four starts. He allowed three runs and eight hits in 5 1/3 innings, with one walk and five strikeouts.
"The difference was working ahead or working behind in the count," Cole said. "When I got ahead, I was able to get outs. When I feel behind, their hitters were able to leverage that and get hits."
Ruiz's single came off Vin Mazzaro. The Phillies catcher, who sat out the first 25 games of the season after being suspended by Major League Baseball for testing positive for a banned stimulant, had just four RBIs all year before Thursday.
Cole left after a one-out walk to Ryan Howard and a single by Dominic Brown.
"It's a situation where I wanted to keep at one (run) and go with the matchups," Pirates manager Clint Hurdle said. "It's a decision a manager has to make. If the guys who come in from the bullpen give up runs, then it's a bad decision and if you leave the starter in and he gives up runs, then it's also a bad decision."
Mazzaro came on and gave up three straight singles. Young's hit loaded the bases and Kevin Frandsen's single tied it before Ruiz lined a shot to center to score Brown and Young.
Revere capped the rally with a run-scoring fielder's choice grounder.
Pinch-hitter Michael Young's sacrifice fly in the eight extended the Phillies' lead to 6-2.
The Pirates scored twice in the bottom of the eighth to make it a two-run game on a pinch-RBI single by Garrett Jones and a double play grounder by Andrew McCutchen.
McCutchen opened the scoring with a two-run double off Hamels in the third. The Phillies cut the deficit to 2-1 on Revere's RBI single in the fifth.
Starling Marte and Jose Tabata each had two hits at the top of the lineup for Pittsburgh. Marte ran his hitting streak to nine games.
NOTES: Pittsburgh RHP A.J. Burnett is likely to come off the disabled list on Sunday and start against the Cubs in Chicago, though Hurdle would prefer the veteran make one minor-league rehab start. Burnett has been out since June 9 with a strained right calf but says he doesn't need to go to the minors. ... Manuel said he'll rest 1B Howard against certain lefty starters but won't use him in a strict platoon with right-handed hitting John Mayberry Jr. ... Young wasn't in the starting lineup, getting a rest in a day game after a night game, though he delivered a sacrifice fly as a pinch-hitter. ... Pirates SS Jordy Mercer sat out after going 1-for-9 in the first two games of the series and making an error on Wednesday that allowed a run to score but was double-switched into Thursday's game in the eighth inning. ... The Pirates open their three-game series with the Cubs on Friday with LHP Francisco Liriano (7-3, 2.23) pitching against RHP Jeff Samardzija (5-7, 3.34) ... The Phillies open a three-game home set with Atlanta on Friday night as LHP Cliff Lee (9-2, 2.59) faces RHP Tim Hudson (4-7, 4.22).