MILWAUKEE -- The Pirates were no match for J.J. Hardy on his bobblehead day, though the umpires certainly didn't do them any favors.

Hardy hit a walk-off single in the 12th inning to propel the Brewers to a 4-3 victory and a series sweep of the Pirates on Sunday afternoon. Pirates manager John Russell and first baseman Adam LaRoche were ejected before the sixth for arguing balls and strikes. Chris Gomez nearly gave the Pirates the lead in the 12th, only to have his controversial grounder down the third-base line ruled foul.

However, it's hard to fault the umpires when you only manage three runs on 16 hits, leaving 14 men on base.

"[We had] a lot of hits, just couldn't come up with the big one," said Russell, who was tossed for the first time in his debut season as the Pittsburgh skipper. "Gomez misses the ball there down the line the last inning. That would have been a big hit, but both sides had opportunities. It seemed like the home team was going to win this one because they had the last at-bat."

Hardy's single came off Jason Davis, the Pirates' sixth pitcher of the day. Davis (1-4) walked Rickie Weeks with one out, and Weeks stole second to get in scoring position with Hardy up.

"The way it was looking, it looked like it was going to come down the bullpens and see how long it could last," Russell said. "I didn't know if it was ever going to end. ... They were busting all day long, just couldn't get it done. Milwaukee did the same thing and came up with the big hit."

Pittsburgh's golden opportunity also came in the 12th. They loaded the bases with no outs against Carlos Villanueva, but Guillermo Mota (4-5) got out of the jam. With one out, Gomez ripped a grounder past third base, but it was ruled foul. He missed putting Pittsburgh ahead by two or three runs by inches and ended up striking out. Actually, if you ask him, he didn't miss at all.

"[They said] it was foul. I told [third-base umpire Andy Fletcher] I thought it was fair," said Gomez, who saw Fletcher after coming out to play defense at third in the Brewers' 12th.

LaRoche and Russell had more detailed conversations with home-plate umpire Bob Davidson prior to the sixth. LaRoche was called out on strikes on a questionable pitch in the fifth. At the time, he told Davidson he thought it was a poor call, but let it go after a few words. Then, the first baseman saw a replay of the strikeout after the fifth, and let Davidson know just how bad the call was.

"I came back in [the dugout], and he just wouldn't take his eyes off me," LaRoche said. "So I held up my hands, told him it was a foot outside. We exchanged some more words, I turned around to go sit down, and he started walking toward the dugout. I came out, and that was it."

Russell then came onto the field to back up LaRoche and was separated from Davidson by second-base umpire Mike Reilly. Russell got his two cents in before being tossed.

"The altercation happened, we got Adam under control and it was over," Russell said. "Bob continued to agitate the situation by coming toward our dugout and yelling. I didn't think that was right."

Before the umpires became the story, starter Paul Maholm matched dominant Brewers left-hander CC Sabathia in innings (six) and pitches (96). Maholm gave up 12 hits and two runs, but managed to go six innings for the 20th straight start, becoming the first Pirate to do so since Rick Rhoden in 1986. He took the accomplishment in stride.

"[That's] me doing my job, nothing else," Maholm said. "That's what's expected. That's what I expect out of myself. It has a lot to do with the defense picking me up and no high pitch counts. That's something you go into every outing trying to do."

Mike Cameron (5-for-5) hit a tie-breaking solo homer off reliever Denny Bautista to put the Brewers ahead, 3-2, in the eighth, which brought in ex-Pirate Salomon Torres for the save chance. Luis Rivas led off with a single and later scored the tying run on a pinch-hit single by Nate McLouth, making his first appearance of the road trip after recovering from a stomach virus.

Matt Capps pitched a perfect ninth in his first outing since coming off the disabled list. The Brewers, who have taken 12 straight from the Pirates at Miller Park, come to PNC Park next weekend. For Maholm, the 12 hits were a season high, a number he can't replicate and expect to win his next start.

"I get to face them again next time out, so hopefully [I'll] draw up a new gameplan," Maholm said. "I don't think the 12 hits will survive again."