Updated

A.J. Burnett reached a franchise milestone, and Casey McGehee hit a three-run homer in a five-run first inning, as Pittsburgh topped Philadelphia, 5-4, in the finale of a four-game series.

Burnett (9-2) became the first Pirates hurler since Dock Ellis in 1974 to win eight straight starts. The veteran right-hander allowed six hits and three runs with two walks and seven strikeouts over 6 2/3 innings.

"Anytime your offense comes out and gives you a lead like that, it helps you relax a little bit and just attack," Burnett said. "That was my plan, to go after these guys. They have a good lineup."

Pedro Alvarez also homered, while Garrett Jones finished with two hits and an RBI for the Pirates, who earned a split in the set after dropping the first two games.

Erik Kratz hit a two-run shot, while Hunter Pence and Placido Polanco knocked in a run each for the Phillies, who completed a 10-game homestand at 5-5.

Kyle Kendrick (2-8) settled down after the first, but was charged with six hits and five runs over seven full frames in defeat.

Burnett departed in the seventh after issuing a two-out walk to Jimmy Rollins. Juan Cruz entered, and Rollins swiped second ahead of a walk to Juan Pierre, but Shane Victorino flied out to left.

Pence began the home eighth with a solo blast to cut the hosts' deficit to 5-4, then Polanco was plunked. Two batters later, Bucs reliever Jason Grilli deflected a Mike Fontenot grounder but couldn't pick it up, leaving two on. Pinch-hitter Jim Thome fanned, and pinch-hitter Ruiz fouled out to end the threat.

Joel Hanrahan worked a scoreless ninth to earn his 20th save, leaving Rollins on third. Pence flied out to center to end the game.

"Our job is to find a way to win, no matter what," Pence said. "We just tried to crawl back, get a few runs. We battled, but that's not quite enough."

The Pirates dented Kendrick for five in the first inning on a Jones RBI hit, a three-run homer from McGehee and a solo shot from Alvarez.

In the home second, Ty Wigginton singled with one out and Kratz drilled a two- out, two-run shot to left center.

Victorino and Pence hit back-to-back singles to put runners on the corners with one out in the bottom of the sixth, and Polanco beat out a potential double-play grounder to score a run for a 5-3 game.

Game Notes

Ellis also won 10 in a row for Pittsburgh in 1971...Burnett also became the third National League pitcher this year to post a perfect record thanks to a 5-0 stretch in June...Washington's Gio Gonzalez and Philly's Cole Hamels also did so in May...Prior to the game, the Phils designated pitcher Chad Qualls for assignment, selected the contracts of Brian Sanches and Jeremy Horst from Triple-A Lehigh Valley and optioned Joe Savery to Lehigh Valley...The Pirates announced the signing of infielder Jimmy Rider, the club's 26th round selection in this year's draft.