MILWAUKEE (AP) -- Ryan Braun homered and Yovani Gallardo pitched seven innings to help the Milwaukee Brewers beat the San Diego Padres 6-5 Sunday.

Martin Maldonado homered to cap a four-run sixth inning for Milwaukee and Braun drove in three runs for the Brewers, who finished a nine game homestand by going 5-4 against the Pirates, Cubs and Padres. The last two teams have the worst two records in the major leagues - San Diego has lost four of five to fall to 20-41, half a game worse than Chicago.

Gallardo (5-5) gave up five hits and two runs, one earned, in seven innings, striking out five and walking two.

San Diego's Anthony Bass (2-6) gave up four runs, five hits and three walks in 5 2-3 innings.

Bass has allowed 19 runs in his last four starts after posting a 2.94 ERA over his first eight starts this season. He was given a 2-0 lead Sunday and pitched well early, striking out the side - all looking - in the fifth. But Milwaukee scored four times in the sixth.

Norichika Aoki reached on an infield single, stole second and advanced to third when catcher John Baker's throw went into center field.

Aoki scored on Braun's single, Aramis Ramirez and Taylor Green flied out and Rickie Weeks walked.

That brought up Maldonado, who hit his second homer in three days and third since being called up on May 29.

Edwin Maysonet followed with a triple to center, just over the leaping Cameron Maybin's glove. Maybin hit the wall hard with his right shoulder and left as part of a double switch after the play. There was no immediate word on his status.

Braun hit his 15th homer of the year in the seventh.

The Padres scored three times in the ninth, forcing out closer John Axford after Chase Headley hit an RBI single and Carlos Quentin walked with the bases loaded.

Jose Veras struck out Yonder Alonso looking, but he walked Jesus Guzman on four pitches to force home another run before he struck out John Baker looking for his first save since June 16, 2011, as a Pittsburgh Pirate.

San Diego scored two early runs thanks to some sloppy play by the Brewers.

Venable led off the game with an opposite-field homer to left on the fourth pitch from Gallardo. It was his second leadoff home run this season and seventh of his career, tying him with Quilvio Veras for the Padres' franchise mark.

The damage was almost much worse for Gallardo. Braun robbed Headley of extra bases with a leaping catch into the out-of-town scoreboard in left, just below the yellow home-run line at the top of the wall.

The Brewers gave away a run in the second. Alonso led off with a single and advanced to second on Maybin's groundout. Baker then hit a dribbler to the mound, but the ball went under Gallardo's glove and between his legs for an error. Everth Cabrera followed with a slow roller down the first-base line. Rather than let it go foul - which appeared likely - Green fielded it and had to make the play at first, allowing Alonso to score.

NOTES: Before the game, the Padres optioned RHP Andrew Cashner to Double-A San Antonio and called up right-hander Brad Boxberger from Triple-A Tucson. Cashner started in the Padres' 5-2 win Saturday over the Brewers, giving up two hits and one run over 2 1-3 innings, striking out five and walking two. Padres manager Bud Black said Cashner would begin his transition from reliever to starter. . The Padres transferred RHP Tim Stauffer (strained right elbow) to the 60-day disabled list. . RHP Marco Estrada, on the 15-day disabled list since May 24 with a right quadriceps strain, will throw a simulated game in Kansas City on Tuesday. Manager Ron Roenicke said he hopes Estrada can make two minor league starts, beginning as soon as Saturday, before taking RHP Mike Fiers' place in the starting rotation.