MINNEAPOLIS — Given an early two-run lead by Dustin Pedroia, starter Rick Porcello of the Boston Red Sox was trying to provide a shutdown inning Wednesday.

Porcello walked Aaron Hicks with one out. And it led to a big inning for the Minnesota Twins.

The next four batters reached and the Twins grabbed the lead and momentum on the way to a 6-4 win and a sweep of their three-game series.

Torii Hunter had a two-run single and Joe Mauer added an RBI single to cap the Twins’ third-inning rally for a 3-2 lead. Two runners who scored, Hicks and Brian Dozier, reached on Porcello’s only walks.

The rally came right after Pedroia gave Boston the lead with a two-run homer in the top of the third.

The shutdown inning then eluded the Red Sox.

“That’s been a little bit of a nemesis so far to date,” Manager John Farrell said. “It’s difficult to maintain momentum when it’s given right back. He gets squeezed on the 3-2 pitch to Hicks, that begins that three-run inning.”

Pedroia homered again with a runner on in the fifth, but that was after Porcello (4-4) allowed a two-run homer to Hicks. He later gave up a solo shot to Eddie Rosario.

“Those tack-on runs were huge,” Porcello said. “Whatever happened in the third inning happened, it’s my job to put up zeroes after that. To give up two home runs after that inning was not that good.”

The Red Sox scored all four of their runs off Twins starter Phil Hughes (4-4), and had opportunities against the bullpen.

Blake Swihart flew out with a runner on second off Brian Duensing to end the seventh. Michael Tonkin got David Ortiz to hit a weak grounder to the left side with two on to end the eighth.

“We’ve just got to find a way to score runs,” Pedroia said. “This isn’t football, you can’t go out there and hit somebody, you’ve got to calm down, you’ve got to think the game and have a good at-bat.”

Minnesota has won 9 of 11 and swept Boston for the first time since June 13-15, 2006.

The Red Sox have lost 6 of 8.

Hughes struck out three and walked none in 62/3 innings. Glen Perkins pitched a 1-2-3 ninth for his 18th save in as many chances.

Hicks’ two-run homer to right field in the fourth gave the Twins a 5-2 lead. It was Hicks’ first homer in 171 at-bats since April 24, 2014.

Porcello (4-4) allowed six earned runs in seven innings for Boston. In his past two starts, Porcello has allowed 13 earned runs in 111/3 innings after allowing just six earned runs in his previous 252/3 innings over four starts.

Pedroia, who hit a two-run home run in the third for a 2-0 lead, hit another two-run shot in the fifth to get the Red Sox within 5-4.

It was Pedroia’s second multi-home run game of the season – the other was Opening Day – and fifth of his career.

“That’s what leaders do, they step up and try to help their team,” Twins Manager Paul Molitor said.

Rosario homered in the sixth to make it 6-4. Blake Swihart nearly tied the game in the seventh, but his drive to left field with a runner on was caught at the wall by Rosario.

NOTES: Before Thursday’s game in Texas, Boston plans to call up left-handed pitcher Eduardo Rodriguez to make his major league debut. “We’re running through a stretch of 20 consecutive games played, so we’re building in a sixth starter this time through the rotation,” Farrell said. Rodriguez, who pitched last year with the Sea Dogs, is 4-3 with a 2.98 ERA at Triple-A Pawtucket. A corresponding move is expected on Thursday. …

Outfielder Rusney Castillo missed the game after jarring his right shoulder on a diving catch in the eighth inning Tuesday. Farrell said Castillo couldn’t get loose throwing and he believes the issue is minor.