Updated

Even though Rickie Weeks' batting average is hovering around .200, Pittsburgh manager Clint Hurdle thought it was best to intentionally walk him to load the bases with two outs in the bottom of the eighth inning of a tie game on Friday night.

After all, Cody Ransom, the next batter, was 0 for 4 in the game.

But he hit his first career grand slam off reliever Tony Watson to lift Milwaukee to a 10-7 victory over the Pirates.

"I don't know if there's ever a no-brainer in this game," Hurdle said. "(Weeks) has been swinging the bat better. He's not a good matchup (for us). Historically, he's been real good against left-handed pitching. Tip your hat to Ransom. Swinging a bat in the big leagues is always a dangerous bet."

Ryan Braun hit two home runs as Milwaukee improved to 40-6 against Pittsburgh at Miller Park since 2007. Martin Maldonado finished with a career-high four hits, all singles, to hand Pittsburgh only its third loss in the last 13 games.

Watson (4-1) entered in the eighth and gave up consecutive singles to Braun and Aramis Ramirez. He struck out Corey Hart, but each runner stole a base on the pitch. The Pirates then elected to load the bases by intentionally walking Weeks, who had driven in two runs with a double in the first inning.

"Obviously, we wanted that guy up there," Watson said. "We intentionally walked the guy in front of him to load the bases. We wanted to go right at him, go ahead in the count. With two outs, I was hoping to put something in play and let the defense work."

Ransom, however, hit a 2-2 pitch over the wall in left-center for his eighth homer of the season.

Milwaukee manager Ron Roenicke wasn't worried in the least.

"I always have that feeling when we have people on base," he said. "It's a lot better to think good things than the other way around. To tell you the truth, I didn't know what he was 0 for."

After the game, members of the media waited to interview Ransom outside his locker while he had to take a drug test.

"That's a Major League Baseball thing," he said. "They tell you when they tell you."

Pittsburgh's Andrew McCutchen hit a solo homer off John Axford in the ninth.

The Pirates had runners on first and second after reliever Manny Parra walked Neil Walker and gave up a single to McCutchen in the seventh. But he got out of the jam by retiring the next three batters.

Francisco Rodriguez (2-4) pitched the eighth.

In the sixth, Braun's second homer tied the score 6-6. Reliever Brad Lincoln hit the first batter he faced, Nyjer Morgan, but he was caught stealing with Braun at the plate. The NL all-star then smacked his league-leading 26th home run to right.

"Whenever you play a 4-hour game, certainly you want to win, because you feel miserable after you lose a 4-hour game," Braun said.

The game was anything but the expected pitcher's duel between Milwaukee's Zack Greinke and Pittsburgh's James McDonald. Both starters entered with 9-3 records but failed to make it to the sixth inning.

Greinke became the first pitcher since Red Faber of the Chicago White Sox in 1917 to start three consecutive team games in a season. But he gave up a solo home run to Pedro Alvarez in the fifth that gave Pittsburgh a 6-4 lead and was lifted in the bottom of the inning for a pinch-hitter. Greinke, 15-0 as a Brewer at Miller Park, allowed five earned runs and seven hits.

"I didn't pitch perfect by any means," Greinke said. "But I'll take at least over 50 percent of the time pitching like that. I didn't pitch perfect, but I wasn't terrible."

McDonald was 7-1 in his previous 10 starts but gave up four earned runs and eight hits in 4 2-3 innings, his third-shortest outing of the season. After a single by Martin Maldonado put runners at first and second with two outs in the fifth, he was replaced by Lincoln. Travis Ishikawa, hitting for Greinke, delivered a single to left to trim the Pirates' lead to 6-5.

"(Pitching coach) Ray Searage said it best," Hurdle said. "He said if we could have hooked up an electrical cord to him, we could have lit up the whole stadium. He was amped up and ready to go. We had a couple of pitchers like that tonight. You get some down time and we weren't real sharp off the mound tonight."

Notes: Braun has 16 multi-homer games in his career, including four this year. . McDonald has not lost since June 15, at Cleveland. ... Milwaukee's Aoki Norichika's 15-game hitting streak came to an end after he went 0 for 3 with two walks. . Greinke started Sunday and lasted only three innings, one day after he was ejected by first-base umpire Sam Holbrook after throwing only four pitches. He has not pitched more than six innings in his last five games and he allowed five or more earned runs for the fifth time.