MILWAUKEE — The Milwaukee Brewers guessed wrong, and Andrew McCutchen made them pay.

McCutchen hit a home run and a pair of RBI singles through the shift, including the tiebreaker in the 10th inning as the Pittsburgh Pirates stopped a nine-game skid in Milwaukee, beating the Brewers 3-2 Thursday night.

McCutchen, who came in batting .246, homered into the second tier of seats in left field off Wily Peralta in the first for his 18th home run of the season. He then hit an RBI single that beat the shift in the third.

“The guy’s a great player, and you saw it tonight,” the Brewers’ Kirk Nieuwenhuis said. “Driving in runs, big at bats. He’s always done that and will continue to do it for a long time.”

Peralta was done after throwing 63 of 100 pitches for strikes in five shaky innings. He walked three and struck out five in his fourth start since rejoining the rotation on Aug. 9. He had been optioned to Triple-A Colorado Springs on June 12 after going 4-7 in 13 starts, including the season opener.

McCutchen has 44 RBIs in 56 career games at Miller Park, his highest total at any opposing park. His blast was the 26th career home run against the Brewers and tied with the Cincinnati Reds for his highest total against any single opponent.

“I know he hasn’t had the great year that he normally has, but he’s a force, no question,” Brewers manager Craig Counsell said.

The Brewers came in having swept the Colorado Rockies and matched their season-high four-game winning for the third time. McCutchen and Pirates starter Chad Kuhl stopped them from a fifth consecutive win, something the club hasn’t done since a six-game streak last Aug. 30 to Sept. 5.

Kuhl, making his first career appearance against Milwaukee, cruised through the first six innings — allowing just two hits. However, he ran out of gas in the seventh.

Pitching coach Ray Searage made a mound visit after Chris Carter’s one-out double and just before Nieuwenhuis stepped in. Whatever was said, didn’t work. Nieuwenhuis hit Kuhl’s first pitch into the seats in right to tie the score. Orlando Arcia doubled to end the 23-year-old rookie right-handers’ eighth start of the season.

Kuhl thought that his slider deserted him in the seventh.

“It was going well for me all night,” he said. “Then, it flattened out. I’m a human, not a robot. I wish I could throw it perfectly every time, but it happens.”

The loss also snapped a chance for Milwaukee to win five straight at home for the first time since July 2015.

Pinch-hitter John Jaso blooped a single off Carlos Torres (2-3) in the 10th, advanced on a sacrifice, took third on a ground out and scored on McCutchen’s liner through the empty right side of the infield.

McCutchen foiled the strategy that moved the second baseman behind the bag, leaving a huge gap between first and second.

Antonio Bastardo (2-0) picked up the win in relief and Tony Watson pitched a scoreless 10th for his eighth save in 11 chances.

Kuhl walked two, snapping his streak of no walks in his three previous road starts. He struck out five in 6 1/3 innings, his longest outing of the season and fifth consecutive time he went at least six innings.

With McCutchen’s winning hit, the Pirates have won seven of Kuhl’s first eight major-league starts.

MARTE’S MOTORING

Marte stole his 43rd base of the season. The last Pirate to record more than 42 steals in a season was Tony Womack who had 58 in 1998.

CALL OVERTURNED

Second base umpire Bob Davidson’s out call on Starling Marte’s attempted steal of second in the Pirates’ fifth was overturned after a 2:34 review.

CREEPY TALE

Pirates manager Clint Hurdle shared a story about ghosts at the team’s hotel during his pregame session with the media.

Baseball players in the past have reported eerie encounters and strange happenings at the Pfister Hotel in downtown Milwaukee.

“I had a player call me one night assuring me of the fact that there is a ghost and it turned his TV on twice during the night,” Hurdle said. “I actually had him come into my room to settle him down. Went back to his room for a while. Sat with him. The TV didn’t come back on. I exited and everything was OK. I don’t want to name names, but he’s still playing.”

TRAINER’S ROOM

Pirates: 3B Jung Ho Kang accompanied the team on the road trip. He’s been on the 15-day disabled list since Aug. 20 with a left shoulder injury.

Brewers: RHP Jacob Barnes is scheduled to begin a rehab assignment at Double-A Biloxi on Friday. He’s been on disabled list since July 27 with right elbow soreness.

UP NEXT

Pirates: RHP Ryan Vogelsong (2-3, 2.98 ERA) makes his seventh start and 17th appearance when he faces Milwaukee for the first time this season. He is 4-0 with a 2.53 ERA in his last six appearances, including five starts, against the Brewers.

Brewers: RHP Matt Garza (4-5, 5.27) faces the Pirates for the third time this season. He is 1-1 with a 4.50 ERA in those two starts and overall, he is 3-4 with a 4.37 ERA in 11 career outings.