The Milwaukee Brewers kept Bernie Brewer active and finished off a three-game sweep of the Pittsburgh Pirates with a 12-8 win on Sunday.

Ryan Braun, Jeff Bianchi, Rickie Weeks, Carlos Gomez and pitcher Yovani Gallardo all homered for the Brewers, who have won seven of their last eight games.

Gallardo was going for his seventh straight win, but was chased from the game after he allowed seven runs on 11 hits in 4 2/3 innings. Kameron Loe (5-4), who gave up a run in an 1 1/3 of relief work, received the win.

"He was out of whack," Brewers manager Ron Roenicke said. "He has thrown so well for so long. He had a game when he just wasn't on. He tried to fight through it and get five innings in."

"He had problems locating his breaking ball," Pirates second baseman Brock Holt said.

James McDonald (12-7) had another rough outing for Pittsburgh. He allowed eight runs -- seven earned -- on six hits, including four home runs, in 2 2/3 innings.

Since the All-Star break, McDonald is 3-4 with a 7.21 earned run average.

Michael McKenry, Gaby Sanchez and Garrett Jones homered, but the Pirates lost for the ninth time in their last 12 games.

Sanchez put the Pirates on top when he drove in Andrew McCutchen with a base hit in the first inning, but the Brewers quickly went ahead.

Norichika Aoki walked and Weeks reached base on Pedro Alvarez's error before Braun slammed his National League-leading 37th home run of the season.

McKenry laced an 0-2 curveball over the left field wall to bring the Pirates within a run in the second, but Bianchi got the run back in the bottom half of the frame with a homer to center.

Later in the second, Aoki singled and Weeks hammered a long home run to center field to give the Brewers a 6-2 lead after two innings.

McKenry knocked in a pair of runs with a base hit in the third, but once again the Brewers responded with the long ball. Corey Hart hit a one-out double in the bottom of the third and Gomez lined a fastball over the left field fence to put the Brewers up 8-4.

Gallardo whacked his 10th career home run and first of the season to start the fourth inning when he lined a 1-2 hanging slider out to left field. After Aoki walked and Weeks singled and stole second, Ramirez rolled a single up the middle to score two and open up a seven-run lead.

Jones led off the fifth with a base hit and Sanchez smacked a two-run shot. Alvarez then worked a walk and scored after back-to-back singles by Travis Snider and Holt.

Jones then pulled the Pirates within three with a solo shot in the sixth inning, but they were unable to get any closer.

Ramirez singled home Weeks in the bottom half of the sixth to cap the scoring.

After Manny Parra gave up a hit and a walk to start the ninth inning, John Axford came on and retired all three hitters he faced to record his 23rd save of the season.

Game Notes

Braun matched his career high in home runs ... Holt went 2-for-5 and picked up his first major league hit in the fourth inning and first RBI ... The Brewers have won six straight home games and 14 of their last 16 ... Pittsburgh went 3-for-11 with runners in scoring position and left nine ... Milwaukee went 6- for-13 with runners in scoring position and stranded five ... Jones went 3- for-3 with two walks ... Braun and Ramirez both knocked in three runs.