PITTSBURGH -- Cole Hamels finally got some help from his teammates on Thursday.
The Philadelphia lefty 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-2, 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, who has received only 22 runs of support in his 11 defeats.
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.
The Phillies (41-45) avoided falling to a season-worst six games under .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.
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.
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 prior to Thursday.
Cole left after a one-out walk to Ryan Howard and a single by Dominic Brown.
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-hit 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 Sunday and start against the Cubs at Chicago, though Pirates manager Clint 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. ... Philadelphia manager Charlie 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. ... 3B Michael 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 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).