Cole Hamels pitched 7 1-3 impressive innings and the Philadelphia Phillies beat the San Diego Padres 7-4 Tuesday night, denying Greg Maddux his 350th career victory.

Hamels (3-3) allowed five hits, two runs and struck out six. Tom Gordon worked out of a bases-loaded jam in the eighth and the Phillies scored four insurance runs in the bottom half.

Maddux (2-2) gave up three runs and eight hits in 6 1-3 innings. The four-time Cy Young award winner was trying for the third start to become the ninth pitcher in big league history to reach 350 wins.

Maddux was two outs away from getting the milestone victory against San Francisco last week, but Bengie Molina hit a tying homer off Trevor Hoffman in the ninth.

On Tuesday night, Carlos Ruiz had a two-run double and pinch-hitter Greg Dobbs added an RBI double as the Phillies broke it open in the eighth against Glendon Rusch and Kevin Cameron.

Scott Hairston hit a pair of homers for San Diego.

Hamels was sharp from the start. Mixing in a changeup and a crisp fastball, the left-hander retired 11 of the first 12 batters before Adrian Gonzalez singled to right in the fourth for San Diego's first hit. Gonzalez was thrown out by Geoff Jenkins trying to stretch it into a double.

Hairston got the Padres within 2-1 when he connected for a solo shot in the fifth. He hit a two-run shot off Ryan Madson in the ninth.

Hamels singled to chase Maddux and help the Phillies regain a two-run lead in the seventh.

After Ruiz singled with one out, Hamels stroked a single to right to put runners at first and third. Maddux wasn't too pleased giving up a hit to a pitcher. Maddux stomped off the mound, took his glove off and nearly slammed it to the ground. It didn't make him any happier when manager Bud Black came out and called for Cla Meredith.

Jayson Werth's sacrifice fly scored Ruiz to make it 3-1.

Hamels left after a one-out walk in the eighth put runners at first and third. J.C. Romero entered and walked his only batter, pinch-hitter Tony Clark. But Gordon preserved the lead. Tadahito Iguchi's groundout scored a run to cut it to 3-2. Gordon then retired Kevin Kouzmanoff on a grounder to leave runners at second and third.

Pedro Feliz's RBI single in the eighth drove in Chase Utley, who doubled. Ruiz and Dobbs hit consecutive doubles to make it 7-2.

Hamels has pitched at least seven innings in each of his six starts. He allowed three runs in his first three outings, but nine runs in the last two.

Ryan Howard poked an RBI single through an extreme shift in the first and Eric Bruntlett had an RBI single in the third.

Notes@: Phillies CF Shane Victorino came off the disabled list. He was sidelined since April 12 with a calf strain. ... Maddux is 29-18 lifetime against the Phillies. ... Philadelphia is 11-8 without injured Jimmy Rollins. The 2007 NL MVP will miss another week with an ankle injury.