SAN DIEGO -- Rene Rivera started his postgame session with the media Wednesday night talking about Padres starting pitcher Odrisamer Despaigne.

That's what catchers do.

Then the subject came around to Rivera's offensive role in the Padres' 3-2, 10-inning win over the Milwaukee Brewers at Petco Park.

"It's always fun to contribute to a win," said Rivera, who tied the game at 2-2 in the ninth with a solo homer off Francisco Rodriguez -- denying the Brewers' closer his 40th save this season. It was his fifth blown save.

With two outs an inning later, Rivera singled to center off left-handed reliever to drive home first baseman Yasmani Grandal from second and give the Padres their seventh series win since the All-Star break.

"What a night for Rene," Padres manager Bud Black said after his team improved to 17-5 over the last 22 games at Petco Park. "You know what I think of the pitcher-catcher work, and Rene did a great job tonight with O.D.

"Then to get those two big hits."

Rivera became the first catcher in four seasons to get a game-tying hit late in the game then drive in the winning run in extra innings.

While the Padres were celebrating a series victory over the National League Central-leading Brewers, Milwaukee manager Ron Roenicke was lamenting a lost opportunity.

If the Brewers had protected their 2-0 lead, they would have departed San Diego with a 2 1/2-game lead over the Cardinals.

"It's always tough to lose games like this," said Roenicke, who was ejected in the ninth inning for arguing balls and strikes with plate umpire Mark Rippenger. "You feel pretty good any time you have a lead in the ninth with Rodriguez in there."

Left fielder Seth Smith opened the Padres' 10th with a walk and moved to second on Grandal's second single of the game. But center fielder Cameron Maybin's attempted sacrifice bunt was turned into a force of Smith at third.

Brewers left-handed reliever Zach Duke then retired pinch hitter Rymer Liriano on a line drive to right for the second out before Rivera bounced his winning single to center to score Grandal from second.

Right-hander Dale Thayer (4-3), the third Padres reliever to throw a perfect inning, got the win. Duke (4-1) suffered the loss.

Brewers right-handed starter Yovani Gallardo worked six scoreless innings, but the bullpen couldn't hold a 2-0 lead.

The Brewers broke up a scoreless game with two runs in the top of the seventh off Despaigne.

First baseman Lyle Overbay singled with one out and scored from first when shortstop Elian Herrera hit a liner that rolled into the right-field corner after passing between Grandal and the first-base bag.

Overbay scored and Herrera reached third as right fielder Will Venable's throw from the corner forced second baseman Jedd Gyorko off line. Herrera scored when a high fastball from Despaigne skipped off Rivera's glove for a passed ball.

The Padres got one of the runs in the bottom of the seventh. Gyorko and Venable opened the inning with back-to-back singles off right-handed reliever Jeremy Jeffress. Gyorko scored on pinch hitter Jake Goebbert's two-out single to left-center.

Despaigne, 27, allowed two runs (one earned) on six hits and a walk with a career-high nine strikeouts in seven innings.

NOTES: Brewers RHP Matt Garza, who has been out since Aug. 5 with a left oblique strain, will make a simulated start in San Francisco Friday. He could return to the rotation next week against the Cubs. ... Padres SS Everth Cabrera could rehab with Class A Lake Elsinore next week during the first round of the California League playoffs.