Josh Collmenter was rolling along through six innings, having allowed only three hits and leading by a run.
He appeared on his way to ending his four-start losing streak. That was, until the seventh inning, when Collmenter was lifted for the normally more reliable Joe Paterson, who was lifted for the normally more reliable Sam Demel.
Patterson gave up two hits in 1/3 of an inning, and Demel gave up the game's biggest hit, a three-run bomb to pinch hitter Casey McGehee that gave the Milwaukee Brewers a 3-1 win over the D-backs Wednesday afternoon at Miller Park.
The Brewers, one of baseball's best teams at home, avoided a home sweep. The D-backs (47-41) missed out on a chance to move to a half-game behind San Francisco in the NL West for first place, and are 1 1/2 games out with the Giants playing tonight.
The Diamondbacks thought they had Brewers starter Yovani Gallardo figured out early, especially after Kelly Johnson drove a 2-0 pitch over the wall in left-center field for a solo home run to lead off the game.
It was Johnson's 15th homer of the season, but the D-backs would score no more. Gallardo (10-5) struck out six over seven innings and allowed just four hits, and the Milwaukee bullpen finished the job.
Arizona had a chance to add to the lead in the seventh, but Miguel Montero got thrown out by left fielder Mark Kotsay trying to make it to third base on a soft single from Sean Burroughs. Montero had doubled with one out.
The Brewers never got a runner past second base until the seventh. Then singles by Kotsay and Jonathan Lucroy with one out set the stage for McGehee.