Rafael Devers celebrated his selection to the Eastern League’s East Division all-star team in the best way he knew how Wednesday night.

Devers, a 20-year-old third baseman, homered twice and drove in three runs to lead the Portland Sea Dogs to a 5-1 victory against the New Hampshire Fisher Cats at Hadlock Field.

In the first inning, Devers, who bats left, lifted a 2-2 fastball over the left-field wall to stake the Sea Dogs to a 1-0 lead.

“He has the ability to drive the ball the other way, and you don’t find guys like that who are able to drive the ball the way he does,” Portland Manager Carlos Febles said.

“He got a good pitch to hit and was able to connect.”

In the third, Devers made it 2-0 when he lined a two-out single to center to drive in Danny Mars, who reached on an infield single and went to second when shortstop Richard Urena threw the ball into the Portland dugout after fielding it on the outfield grass behind second base.

Leading off the bottom of the fourth, Michael Chavis, in his fifth game with Portland since his call-up from Class A Salem, pulled the first pitch he saw over the left-field wall for his second homer since joining the team. The blast traveled an estimated 397 feet.

Devers struck again in the fifth. With one out, he pulled is team-leading 16th home run of the season to right for a 4-0 lead.

It took the Fisher Cats six innings to get to Portland starter Kevin McAvoy, who allowed one hit through his first five innings.

“He mixed pitches well, and (had) a good cutter (and) sinker working for him,” Febles said. “Every time he got into trouble he bounced back and made pitches.”

“I threw a lot of curveball, and I think that helped,” said McAvoy (3-5). “I was working down, which is something I’ve been working on in the bullpen and on the side.”

With one out in the sixth, Urena doubled off the left-field wall for the Fisher Cats, then scored on Ryan McBroom’s two-out single to center.

Portland completed the scoring when Chad De La Guerra led off the bottom of the seventh with a double and scored on Jeremy Barfield’s two-out single.

It was the Sea Dogs’ third consecutive win over the Fisher Cats.

“We are playing a little better lately, and we’re using it to build on,” Febles said.

“We started (the season) off hot and (then) we lost four or five guys. If you’re playing well in the minor leagues, that means you’re going to lose guys quick. We’re here to help those guys get better in order to get promoted.”

NOTES: Boston Red Sox pitcher Eduardo Rodriguez will start Thursday night in the series finale against the Fisher Cats. Rodriguez, a left-hander, joins infielders Brock Holt and Josh Rutledge as Boston players to do a rehab assignment with the Sea Dogs this season. As a member of the 2014 Sea Dogs, Rodriguez went 3-1 with a 0.96 ERA. … Portland right fielder Henry Urrutia, who had a six-game hitting streak, left the game after striking out in the second because of back spasms. … In his five games with the Sea Dogs, De La Guerra has 12 hits in 19 at-bats. … The announced paid attendance was 4,415.