MILWAUKEE — Craig Counsell gave Junior Guerra an opportunity to complete a shutout.

But once the Pittsburgh Pirates put the tying run on first base, the Milwaukee manager decided to go to his closer. It took Jeremy Jeffress one pitch to work out of trouble to give the Brewers a 3-1 win Friday night.

The Pirates managed Andrew McCutchen's RBI groundout off Guerra (7-2), who departed with two on and two outs in the ninth. Jeremy Jeffress got Jung Ho Kang to ground out to third base on one pitch to record his 25th save in 26 chances.

"He really earned the right to get through that inning, I thought, and I did want him to get through the inning," Counsell said. "I really wanted him to get through the inning. I thought he pitched like he deserved to, and I don't think he was tiring or anything like that."

Guerra entered the ninth with a scoreless streak of 19 1/3 innings. He allowed four hits, struck out five and walked one. During one stretch, the 31-year-old rookie retired 12 straight Pirates.

Counsell visited the mound after Guerra walked John Jaso to put two on with nobody out in the ninth. The right-hander thought he was coming out of the game, but his skipper kept him in.

Gregory Polanco and McCutchen then hit into fielder's choices before Starling Marte chased Guerra with a single up the middle that hit off the second-base umpire.

"I really wanted it," Guerra said through an interpreter. "I'm thankful Craig had confidence in me to get it. Unfortunately I didn't get it. But that's baseball for you. Sometimes it doesn't go your way."

Making just his second major league start, Pirates rookie Steven Brault (0-1) gave up three runs and seven hits over six innings. Recalled from Triple-A Indianapolis on Friday, Brault kept Pittsburgh in the game. He stranded a pair of runners in scoring position in the second and fourth innings.

"There wasn't a clean inning out there," Pirates manager Clint Hurdle said. "However he made pitches."

Chris Carter's two-run home run in the first inning was his 23rd of the season and his first since July 8.

Pirates catcher Francisco Cervelli had to be helped off the field in the eighth inning after a pitch from Juan Nicasio glanced off Scooter Gennett's leg and hit him directly on the inside of his right foot.

Guerra has been a pleasant surprise for the Brewers since coming to the major leagues on May 3. He is 4-1 with a 1.47 ERA over his last seven starts.

"Fastball command was really solid," Hurdle said. "He's got swing-and-miss stuff after that whether it's the split or the breaking ball, changeup."

HOME COOKING

Carter's home run Friday was his 17th of the season at Miller Park, giving him the most by any player in his home ballpark this season. Colorado's Trevor Story and Baltimore's Mark Trumbo each have 16.

STOLEN BASE RACE

Brewers SS Jonathan Villar and Marte entered Friday tied for the most stolen bases in the major leagues at 36. Villar took the lead by swiping his 37th base of the season in the seventh inning.

TRAINER'S ROOM

Pirates: RHP Ryan Vogelsong made his fourth rehab start Wednesday. He allowed two runs on five hits over seven innings. Vogelsong has been out since May 24 with facial fractures.

Brewers: LF Ryan Braun missed his second consecutive game Friday with right side tightness. Counsell hopes to have Braun back Saturday. "Just a little bit tight; waiting for it to loosen up," Braun said.

UP NEXT

Pirates: RHP Jameson Taillon (2-1, 3.60 ERA) will make his eighth career start and his second against Milwaukee. He allowed one run on five hits over six innings July 19 against the Brewers.

Brewers: RHP Chase Anderson (5-10, 5.40) will try for his first quality start since June 8 when he faces Pittsburgh. He snapped a four-game losing streak last time out by allowing two runs in five innings July 25 against Arizona.