Ken Giles took the Citizens Bank Park mound late Tuesday with 12 scoreless June frames to his name. The Phillies' 24-year-old setup man retired the first two Milwaukee Brewers he faced.

Then the inning unraveled.

Giles' 38th pitch of a laborious eighth inning put Adam Lind on first base and walked in the Brewers' go-ahead run. The Phillies spoiled a great start by ace Cole Hamels and lost, 4-3, in a battle of baseball's two worst teams.

"I think he knows what he did. He made a couple of bad pitches," interim manager Pete Mackanin said. "But Kenny's done so well for us and he's going to be a part of the future, so you've just got to keep positive and point him in the right direction."

The blown lead by Giles ensured that the Phillies finished June with only two wins from their starting rotation in 27 games. It was the fifth 20-plus-game month in franchise history - the first since June 1997 - in which their starting pitchers won two or fewer decisions.

Hamels, who is beginning perhaps his final month in a Phillies uniform, overcame a high early pitch count to log seven innings and allow only two runs, both in the first inning. The rebuilding team's most valuable trade chip allowed just five hits, struck out seven, and walked one over 111 pitches.

When Hamels exited the game, which was delayed 79 minutes at the start because of rain, the 31-year-old lefthander was in line for his first win since May 23. Carlos Ruiz made that possible with a sixth-inning swing, his first home run of the season. The 36-year-old catcher went 244 plate appearances between homers before lifting Taylor Jungmann's 3-0 pitch just over the left-field fence.

In lasting only two-thirds of an inning and allowing two runs, Giles raised his ERA to 2.12. After opening the frame by inducing a Jean Segura line-out and striking out Jonathan Lucroy, the hard-throwing righthander allowed consecutive singles to Ryan Braun, Carlos Gomez, and Aramis Ramirez, the last of which tied the score at 3.

Giles then missed with a slider to Gerardo Parra to load the bases for Lind. Coming off the bench as a pinch-hitter, Lind watched four consecutive fastballs miss the zone before taking first base. Luis Garcia entered to get the inning's final out.

"That was disappointing," Mackanin said of Giles. "He threw pretty well. Unfortunately, Chooch called timeout with that pitch on its way and we had Gomez struck out, which was tough. But that happens."

After waiting out the rain delay, Hamels dug himself an early hole in a 27-pitch first inning. After the pitcher walked Lucroy, third baseman Maikel Franco failed to barehand a Braun chopper. A ground ball moved both runners into scoring position, and Ramirez drove them in by smacking Hamels' 2-2 cutter up the middle for a single.

The Phillies got one run back in the second on an error by the catcher, Lucroy. With the bases loaded, Freddy Galvis hit a first-pitch ground ball to first baseman Jason Rogers, who recorded the force-out at home. Lucroy threw to first to attempt the double play, but his throw bounced into the outfield, allowing Cody Asche to score.

They tied the game in the next inning on Domonic Brown fielder's choice ground ball with the bases loaded. Neither team scored again until Ruiz's home run off Jungmann, the Brewers' rookie starter who lasted six innings.

After the Brewers' two-run eighth against Giles, the Phillies loaded the bases in the bottom of the inning with one out for Darin Ruf. The threat quickly dissipated when Ruf bounced Jeremy Jeffress' fastball into an inning-ending 5-4-3 double play.

Facing Milwaukee closer Francisco Rodriguez in the ninth, the Phillies created another scoring opportunity. But with runners on first and second and no out, Franco struck out, Andres Blanco popped out, and Jeff Francoeur struck out to end the game.