The Cubs ended their three-game losing streak Monday night with a shut out of the first place Milwaukee Brewers.

The only run of the game came in the eighth on a fielder’s choice ground out off the bat of Aramis Ramirez, his 27th RBI of the season.

Darwin Barney reached on a one-out single to left in the eighth. Carlos Pena hit for Jeff Baker and just missed a homer to left. The ball hit off the ivy, just under the basket and Barney slid into third on Pena’s double.

With runners on second and third, the infield in and the shift on, Aramis Ramirez hit a grounder up the middle to Rickie Weeks. Barney broke on contact and got his hand in just ahead of Jonathan Lucroy’s tag.

Ryan Dempster put together his best outing of the season despite a lot of deep counts and pitching from behind in the count. Dempster was unable to pick up the win because the Cubs offense could not push across a run against Randy Wolf. Dempster allowed just four hits, two in the fifth inning, walked one and struck out seven on 109 pitches, 68 for strikes. Dempster’s only free pass was an intentional walk to Prince Fielder in the first inning.

Jeff Samardzija pitched a perfect eighth and Carlos Marmol picked up his 13th save by striking out Casey McGehee, with Fielder on first, to end the game.

With Monday’s win, the Cubs posted their 13th home victory of the year (13-19) and improved to 26-39 on the season, 13 games below the mediocre mark …

Not to take too much away from Monday night’s victory, but the Cubs continued to show why they are closer to the cellar in the central than the top. The Cubs defense committed their league worst 53rd error of the season (Castro with a throwing error, his 12th) and executed one of the worst rundowns one will ever see at the Major League level (a 2,5,1,6,4,2 on a botched squeeze attempt).

Cubs pitching really stepped up Monday night and held the Brewers’ high-powered offense to just four hits. Prince Fielder was issued the only two walks of the night. The Brewers did not manage a hit after the fifth and only one baserunner after the fifth inning. Dempster, Samardzija and Marmol retired 11 in a row before Fielder worked a walk in the ninth.

Starlin Castro (2-for-4 with a double) and Darwin Barney (1-for-4 with a run scored) continued to perform at the top of the lineup. Jeff Baker was 1-for-3 in his return to the lineup.

D.J. LeMahieu made his professional debut at first base. LeMahieu was 1-for-3 with his first clean hit at the big league level. LeMahieu could not scoop Castro’s low throw in the second but made every other play on the night.