MILWAUKEE (AP) – Ian Stewart hit a solo homer and scored the go-ahead run on an error, helping the Chicago Cubs beat the Milwaukee Brewers 8-2 Sunday to avoid a three-game sweep by their division rivals.

It was the fourth homer of the season for Stewart, hitless in his previous four games. Reed Johnson added a pinch-hit home run in the sixth for Chicago.

The Cubs won despite a relatively short outing from starter Jeff Samardzija, who threw 91 pitches in five innings despite giving up only one run on three hits and two walks. The converted reliever had won two straight coming into Sunday.

Struggling Cubs reliever Kerry Wood pitched a scoreless eighth, stranding Ryan Braun on third, and Michael Bowden finished the ninth.