Updated

A.J. Burnett threw 6 2-3 sharp innings to win his eighth straight start, Casey McGehee hit a three-run homer and the Pittsburgh Pirates beat the Philadelphia Phillies 5-4 Thursday.

Pedro Alvarez also went deep for Pittsburgh, which split the four-game set in Philadelphia by winning the last two. The surprising Pirates, seeking their first winning season since 1992, are 40-35 and second in the NL central.

Burnett (9-2) allowed three runs and six hits, striking out seven. The winning streak is his longest, and it's the first time a Pirates pitcher has won eight in a row since Dock Ellis in 1974.

Joel Hanrahan tossed a scoreless ninth for his 20th save in 22 tries. He retired Hunter Pence on a shallow fly with the tying run on third to end it.

Eric Kratz and Pence hit homers for the Phillies.

The Pirates jumped on Kyle Kendrick (2-8) for five runs before he recorded a second out in the first.

Drew Sutton led off with an infield single and Neil Walker walked. One out later, Garrett Jones hit an RBI single.

McGehee followed with a three-run shot to left. Alvarez then lined one out to right to make it 5-0.

Kratz connected off Burnett in the second to cut it to 5-2.

Burnett retired nine straight before consecutive singles by Shane Victorino and Pence put runners on first and third with one out in the sixth. Placido Polanco's fielder's choice grounder scored Victorino to cut it to 5-3.

Pence led off the bottom of the eighth with a shot off Jason Grilli for his first homer since June 2 and 14th of the year. Pence snapped a 98 at-bat homerless drought.

Grilli pitched out of a jam with two runners on to preserve the lead. He struck out pinch-hitter Jim Thome and retired pinch-hitter Carlos Ruiz on a foul pop. First baseman McGehee made a nice running catch and held onto the ball after stumbling into the first row down the right-field line.

Kendrick settled down nicely after the awful start. He gave up five runs and six hits in seven innings.

This was Burnett's first appearance in Philadelphia since losing to Cliff Lee and the Phillies in Game 5 of the 2009 World Series. Burnett beat Pedro Martinez in Game 2 that year and the New York Yankees prevented the Phillies from repeating as world champions by taking the Series in six games.

The Phillies finished 5-5 on their longest homestand of the season. The five-time defending NL East champions fell to last place and are 36-42, including 17-24 at home.

NOTES: Phillies designated RHP Chad Qualls for assignment and called up RHP Brian Sanches and LHP Jeremy Horst. ... Ryan Howard is set to start a rehab stint at Class A Lakewood on Thursday night. The 2006 NL MVP hasn't played for the Phillies this season after tearing his left Achilles' tendon last October. ... Burnett is 6-0 on the road. ... McGehee has hit all five of his homers in June. ... The Pirates went back-to-back for the third time this season. ... The Phillies had their 261st straight sellout, including postseason games. ... Lee (0-4, 3.72) tries again for his first win when the Phillies open a three-game series in Miami on Friday night. ... Kevin Correia (3-6, 4.03) starts for the Pirates in St. Louis on Friday.

___

Rob Maaddi can be reached at http://www.twitter.com/RobMaaddi