The Phils won a wild one last night, topping the Padres 7-5 in 13 innings.

Cole Hamels had an ugly start, allowing five runs over six innings. The Phils went into the seventh down 5-2, but scored an unearned run in that frame and got a two-run homer from Delmon Young in the eighth to tie the game at 5-5. In the top of the 13th they scored a pair of unearned runs with the help of Logan Forsythe errors, putting them on top to stay.

The bullpen, which has been atrocious this year, was outstanding in the game. Hamels left after six innings and was followed by five Phillie relievers who combined to toss seven shutout innings.

The Phillies are 38-41 on the year after beating the San Diego Padres 7-5 in 13 innings last night. The Phillies take the series two games to one. Since the end of the day on April 25, the Phillies have gone 29-27, which ties them with the Braves for the best record in the NL East. They started the year by going 9-14, though, which has them in third place in the division, seven games behind the first-place Braves.

Hamels got the start for the Phillies and went six innings, allowing five runs, four earned, on seven hits and two walks. Five of the hits went for extra-bases, four doubles and a home run. He struck out five.

Hamels has the worst numbers of his career after 17 starts. Worst ERA (4.58) and worst ratio (1.30). He has a 4.97 ERA and a 1.34 ratio over his last nine starts.

Up 1-0, he walked Carlos Quentin with two outs in the bottom of the first. He struck Chase Headley out swinging to leave Quentin at first.

The Phils led 2-0 when Hamels set the Padres down in order in the second.

Pedro Ciriaco bunted for a single to start the third and scored on a one-out double by Logan Forsythe to cut the lead to 2-1. Chris Denorfia was next and lined a single to right. Delmon Young didn’t handle the ball and it rolled over to Mayberry in center. Forsythe scored (2-2) and Young was charged with an error. Hamels got Quentin and Headly on a pair of fly balls to keep Denorfia at first.

Young wasn’t going to catch Denorfia’s ball, but the Phillies got pretty lucky it wound up so close to Mayberry after he kicked it.

Hamels struck out Kyle Blanks and Yasmani Grandal in a 1-2-3 fourth.

He got the first two to start the fifth before Forsythe doubled to right-center. It brought Denorfia to the plate and Denorfia hit a 2-0 pitch out to left, putting the Padres up 4-2. Quentin grounded to third for the third out.

Righties Forsythe and Denorfia go double/HR back-to-back off of Hamels with two outs and nobody on. Righties are slugging .467 against him this year and .397 for his career.

Headley and Blanks doubled back-to-back to start the sixth, with Blanks’s double scoring Headley to make it 5-2. Hamels got the next two batters before walking Ciriaco intentionally to pitch to the pitcher Robbie Erlin. Erlin went down swingin to leave Blanks at second.

The lead was cut to 5-3 when JC Ramirez set the Padres down in order in the seventh.

Ramirez was back for the eighth with the game tied at 5-5 and threw another 1-2-3 frame on three ground balls.

Second appearance of the year for Ramirez. He hasn’t allowed a hit or a walk to the nine batters he has faced while striking out four over three innings.

Aumont started the ninth and walked the leadoff man Grandal on five pitches. Will Venable ran for Grandal at first and Ciriaco bunted. Aumont fielded and threw to second in time to force Venable for the first out. Lefty Mark Kotsay hit for the pitcher Dale Thayer and grounded to second for the second out with Ciriaco moving up to second. Aumont got behind Forsythe 3-0 and then put him on intentionally, leaving runners on first and second with two down for Denorfia. Denorfia flew to center to end the inning.

You really, really don’t want to walk the leadoff batter in the bottom of the ninth in a tie game, but Aumont gets away with it here with the help of the failed sacrifice by Ciriaco.

Aumont came back to throw a 1-2-3 tenth.

Two scoreless innings for Aumont in which he walks two. He’s walked 12 in 15 innings for the year. First appearance for him with the Phillies since May 20.

Diekman pitched the eleventh. He allowed a one-out single to Nick Hundley. Ciriaco followed and grounded to short with Diekman forced at second for the second out. Lefty Alexi Amarista hit for the pitcher Tim Stauffer and Diekman got him on a fly ball to Mayberry to set the Padres down.

Diekman gets a break as San Diego calls on the lefty Amarista to hit for the pitcher. He allows a hit in his scoreless inning. Still hasn’t walked a batter in five innings over six appearances, but opponents have hit .348 against him.

Savery struck out Quentin in a 1-2-3 twelfth.

2.25 ERA and a 1.00 ratio for Savery after eight innings over six appearances. Righties are hitting 136/208/273 against him.

Papelbon started the thirteenth with the Phillies on top 7-5. Jesus Guzman singled to left with two outs and took second on defensive indifference. Hundley hit as the tying run, but Papelbon struck him out swinging 2-2 to end the game.

Only outing of Papelbon’s last four in which he wasn’t charged with a run.

Overall the pen went seven scoreless innings in the game, allowing two hits and two walks while striking out four. Aumont threw 31 pitches and Ramirez 21. Everyone else was 15 or lower.

The Phillie lineup against lefty Robbie Erlin went (1) Rollins (2) Utley (3) Michael Young (4) Howard (5) Brown (6) Delmon Young (7) Mayberry (8) Ruiz. Mayberry in center against the lefty with Revere on the bench. Delmon Young plays right.

Utley singled to left with one out in the top of the first and scored when Michael Young followed with a double to center, putting the Phils up 1-0. Howard moved Young up to third with a ground out to first, but Brown grounded to first to end the inning.

Delmon Young doubled to left to start the second. He took third on a fly out by Mayberry and tagged and scored when Ruiz flew to center for the second out. 2-0. Hamels struck out looking to set the Phillies down.

Utley and Michael Young both struck out as the Phils went in order in the third.

The Phillies went in order again in the fourth with the game tied at 2-2. Howard and Delmon Young both struck out in the frame.

Howard has struck out 13 times in his last 29 plate appearances (about 44.8%).

Ruiz walked with one out in the fifth and Hamels bunted him up to second with the second out. Rollins lined to short to end the frame.

The Phils were down 4-2 when they went in order in the sixth. Howard struck out swinging for the third out.

It was 5-2 when Brown singled to center to start the seventh. Erlin struck Delmon Young out swinging for the first out and righty Nick Vicent came in to pitch to Mayberry. Mayberry struck out looking for the second out before Ruiz moved Brown up to second with a single to left. Frandsen hit for Hamels and hit a foul ball that should have set the Phillies down, but Blanks just dropped it for an error. It gave Frandsen another chance and he singled to right, scoring Brown (5-3) and moving Ruiz up to second. Lefty Joe Thatcher took over for Vincent and got Utley on a ground ball to leave the runners stranded.

The error by Blanks gives the Phils an extra out and Frandsen gets them a run with the two-out single.

Brown continues to hit well against lefties, singling off of Erlin to start the frame. He’s hitting 301/333/575 against left-handed pitching for the year.

Brown doubled softly to right off of Thatcher with two outs in the eighth. Righty Luke Gregerson came in to pitch to Delmon Young and Young homered to left on a 1-2 pitch, tying the game at 5-5. Mayberry grounded to third to set the Phillies down.

Righty Dale Thayer set the Phils down in order in the ninth. Nix hit for Ramirez and struck out looking for the second out.

Nix is 0-for-his-last-4 with four strikeouts.

Righty Tim Stauffer set the Phillies down in order in the tenth and again in the eleventh.

Ruiz singled off of righty Huston Street to start the twelfth. Galvis hit for Diekman and bunted, but the first baseman Guzman fielded and threw to second in time to get Ruiz for the first out. Rollins hit into a double-play to set the Phillies down.

Galvis can’t sacrifice Ruiz up to second. He’s 11-for-his-last-78 (.141) going back to May 25.

Lefty Tommy Layne started the thirteenth for the Padres and hit the leadoff man Utley. Michael Young flew to right for the first out and Howard flew to left for the second. Brown was next and drew a walk, putting men on first and second with two outs for Revere. Revere hit a 2-2 pitch pretty hard on the ground towards right. Forsythe tried to field it moving to his first, but booted the ball, then fell down. Utley tried to score from second, so Forsythe picked the ball up and threw home. The ball and Utley arrived at the plate at the same time. It hit Utley and bounded away. Utley was safe (6-5) and Brown was able to score from first. 7-5. Forsythe was charged with two errors on the play, one for the boot and one throwing home to try to get Utley. The throw home was fine, it just hit the runner. It left Revere on second with two outs for Mayberry. Mayberry hit a ball up the middle. Ciriaco made a nice diving play to stop the ball from getting into the outfield. Revere tried to score from second, but was thrown out by a wide margin to end the frame.

Utley starts the rally with a hit-by-pitch, reminding that he led the NL in that category three years in a row from ’07 to ’09 and was third in ’10 and again in ’11.

Phillies just got lucky to score two runs on what should have been a ground out to second. Revere had a nice eight-pitch at-bat and battled, but made a bad base-running play to get thrown out at home on the ball hit by Mayberry.

Rollins was 0-for-5 with a walk in the game. 2-for-13 with two singles and two walks in the three-game set. 257/322/361 for the year. Watch out for his isolated power, which is in danger of going under .100. .159 for his career.

Utley 1-for-5 and hit by a pitch. 4-for-13 with two walks, a hit by pitch and a home run in the series. 231/310/385 in 29 plate appearances since his return. 266/335/462 for the year.

Michael Young 1-for-6 with an RBI-double in the first. 3-for-16 with a double in the series. 281/342/396 on the year. Notable Phillies slugging under .400 for the season include Michael Young, Rollins and Ruiz.

Howard 0-for-6 and struck out three times. 0-for-10 with five strikeouts in the set. In the starting lineup against a left-handed pitcher and hitting cleanup, but ends the day with a 175/225/297 line against left-handed pitching for the year. He’s struck out in about 46.2% of his chances against lefties this season and his .225 on-base percentage against them benefits from two hit-by-pitches. He’s hammering righties to the tune of 309/363/545 and striking out in only about 23.7% of his chances against righties. 272/325/475 for the year overall.

Brown goes 2-for-5 with a double and a walk and scores three runs. 4-for-14 with two walks, a double and a home run in the set. 276/324/545 for the year.

Delmon Young 2-for-4 with an error, a double and a two-run homer. Ties the game in the eight with his two-run shot. 3-for-7 in the series. 230/284/419 for the year. Hitting just 200/293/343 against lefties. That’s problem if you’re going to be a terrible defensive player who can’t hit righties.

Mayberry 1-for-6. 5-for-13 with a double in the series. Four walks in his last 109 plate appearances and a .310 on-base percentage for the year. 260/310/434 on the season.

Ruiz 2-for-3 with a walk. 6-for-11 with a walk in the series. 273/310/299 on the year. Two extra-base hits in 84 plate appearances, both doubles.

Pettibone (3-3, 4.14) faces righty Zack Greinke (4-2, 3.79) tonight in LA. Opponents are hitting .295 against Pettibone for the year. Lefties 316/394/463. He’s threw to a 3.00 ERA over his first six starts, but a 5.46 ERA over his last six. Seven strikeouts in 20 1/3 innings over his last four outings. Greinke has been very good in three of his last four starts and allowed five runs in five innings against the Pirates in the other. He hasn’t allowed a home run to a right-handed batter in his 57 innings this season.