MILWAUKEE — Mookie Betts got what he wanted.

Betts’ three-run home run in the ninth inning Thursday lifted the Boston Red Sox to a 4-1 victory over the Milwaukee Brewers. It was Betts’ fifth homer of the season and third in his last four games, and helped Boston salvage one win in the three-game series in the Red Sox’s first trip to Milwaukee since 2003.

Boston’s right fielder enjoyed his time at Miller Park, as he went 7 for 11 with eight RBI and five runs scored.

“He’s certainly impacting the baseball,” Boston Manager John Farrell said. “He’s come up big in so many situations. But this was probably as big of a swing as he’s had all year for us.”

Milwaukee closer Neftali Feliz (0-4) came on in the ninth, but managed to get only one out. Red Sox pitcher Craig Kimbrel (2-0) got the final five outs as Boston snapped the Brewers’ three-game winning streak.

Christian Vazquez led off the ninth with a walk. He was safe at second on a fielder’s choice when Deven Marrero’s bunt was fielded by Feliz, but his throw to second base was dropped by shortstop Orlando Arcia.

Betts followed with a deep shot to left to help Boston wrap up its six-game trip with a 3-3 record.

“I was just trying to be ready for a fastball,” Betts said. “He throws 100, so that’s his best pitch. I was able to get a good one and put a good swing on it.”

Boston quickly got on the board in the first inning. Betts led off with a double, took third on a sacrifice bunt by Dustin Pedroia and scored when Xander Bogaerts’ ground ball rolled under the glove of first baseman Jesus Aguilar.

In the bottom of the inning, Boston starter Eduardo Rodriguez gave up a one-out double to Keon Broxton, but then retired the next 13 batters. In the sixth, he allowed a leadoff single to Manny Pina, who scored on a two-out double to left by Jonathan Villar.

Rodriguez, who struck out five and allowed three hits in six innings, has given up five earned runs in his last 291/3 innings.

His counterpart, Jimmy Nelson, struck out eight, allowed four hits and an unearned run in 62/3 innings.

“Both starters were excellent,” Milwaukee Manager Craig Counsell said. “It felt like it was a game where runs were going to be pretty tough to come by.”

NOTES: Boston’s Mitch Moreland hit a foul ball that knocked the facemask straight over the head of catcher Pina and sent him on his backside. A few innings later, Red Sox catcher Vazquez’s mask was jarred off on a ball hit by Villar. … Before the game, Boston recalled LHP Robbie Ross Jr. from Triple-A Pawtucket after the team optioned RHP Kyle Kendrick there Wednesday night. Kendrick (0-2) was shelled for six runs and 10 hits in 41/3 innings on Wednesday, giving him an earned run average of 12.96 this season. … Hanley Ramirez, who left the game Wednesday with a muscle spasm in his upper back, received treatment in the morning and did not play.