MILWAUKEE -- Wily Peralta didn't know when he took the mound Tuesday night that the Brewers had taken the field a record 407 straight times between complete games.

Milwaukee's wildly inconsistent right-hander ended that slump, tossing a three-hitter to give Milwaukee a 2-0 victory over the Cincinnati Reds for his first career shutout.

Peralta's solid outing was the Brewers' first complete game since Yovani Gallardo's two-hit shutout on April 5, 2011 -- a span of 407 games that the Brewers said was the longest such drought in major league history.

"It's a great feeling. I got a little bit of adrenaline going," said Peralta. "It was my first time that I threw in the ninth inning. It was exciting."

Logan Schafer had a little excitement of his own and provided Peralta with all the support he needed, driving in both runs with his first career homer.

Peralta (6-9), whose start was pushed back from Sunday to give his ailing left hamstring a few extra days of rest, struck out six and walked four. He was aided by two double plays and also picked a runner off first. The Reds also had a runner thrown out at home.

"Outstanding command today," Brewers manager Ron Roenicke said. "Down in the zone with a really good sinker and I really thought he got the slider working well as the game went on. Threw some good change-ups. It was quite a ballgame."

Tony Cingrani (3-1) was almost as effective as Peralta, allowing just two singles in addition to Schafer's two-run homer, striking out 10 and walking two in seven innings.

Schafer, a last-minute replacement for Norichika Aoki, broke up the scoreless duel in the fifth. Martin Maldonado battled back from an 0-2 count for a leadoff walk and Schafer drove the first pitch 429 feet over the wall in right-center to put the Brewers up 2-0.

"One mistake, well, two mistakes; the walk and then I tried to get ahead of Schafer and he jumps me," said Cingrani. "It's frustrating. I thought I did my job."

"Cingrani actually threw a better game," Reds manager Dusty Baker said. "He had more strikeouts. But there's only one left-handed hitter in the lineup. He walks Maldonado and the only left-handed hitter in the lineup hits a home run. When you're not going too good, these things happen."

Derrick Robinson was within a hand swipe of putting the Reds on the board in the seventh when he sliced an opposite-field triple into the left-field corner. The ball eluded left fielder Jeff Bianchi, normally a utility infielder who came on to start the inning as a defensive replacement for Ryan Braun. Robinson tried to score on the play but was nailed on his reach back slide at home on a perfect relay throw from shortstop Jean Segura.

"Where we were, it looked like he blocked the plate on him," Baker said. "You saw it better than we did. When things aren't going good, those kind of things happen.

The Reds also threatened in the ninth when Joey Votto walked with two outs and advanced on a wild pitch, but Brandon Phillips grounded out to short.

"When I walked Votto, I had the feeling they were get let me finish up with Phillips," Peralta said. "When I walked Votto, I just kind of stepped back and said make one pitch at a time and that's what I did."

Roenicke said he probably would have pulled Peralta had Phillips gotten on.

"It was going to be a bad decision if Phillips got on there," Roenicke said. "That was going to be a tough one."

Braun, in the starting lineup for the first time since going on the disabled list June 10, singled in the first inning on the first pitch he saw. He grounded out to short and flied to right before being lifted.

Game notes

Aoki was in the starting lineup in right field and as the leadoff hitter, but was a pre-game scratch with left elbow tightness. ... Reds left fielder Chris Heisey left the game after getting hit on the left elbow by a pitch from Peralta in the second inning. X-rays were negative. "He said his feeling didn't come back and that's why we took him out," Baker said. "I don't think he's playing tomorrow." ... Reliever Sam LeCure pitched one scoreless inning, extending the Reds' bullpen scoreless streak to 23 1/3 innings, spanning eight games. . The victory was only the fifth of the season for the Brewers when scoring less than four runs (5-33).