HERSHEY, Pa. — Rob Flick’s goal in the third overtime lifted the Portland Pirates to a 2-1 victory against the Hershey Bears in Game 3 of the Atlantic Division semifinals Thursday night at the Giant Center.

The game was the longest in Pirates history and the 20th longest in AHL history.

Flick took a cross-ice pass from Rob Schremp and blasted a shot from the right circle past Hershey goalie Justin Peters at 3:10 of the third overtime. Portland finished with 44 shots and goaltender Mike McKenna had a strong night with 41 saves.

The Pirates took a 2-1 lead in the best-of-five series and will look to close it out Saturday night in Hershey. If Game 5 is needed, it will be held Sunday.

The series winner will take on the Wilkes-Barre/Scranton Penguins, who already eliminated the Providence Bruins in three overtime games.

The score was 1-1 after regulation and stayed that way for another 43:10.

The Pirates did receive some reinforcements for the remainder of the playoffs when Greg McKegg, Mike Matheson and Logan Shaw rejoined the team from the parent Florida Panthers after the Panthers were eliminated from the NHL playoffs.

Those reinforcements helped.

Portland tied the game at 1-1 when McKegg scored his first playoff goal by skating through the defense, around the net, and tucking the puck over Peters’ glove hand with 13:32 remaining in regulation.

Neither team was fluid for long stretches or able to find the net with man advantages. The teams combined to go 0 of 16 on power plays with the Pirates missing on nine opportunities.

Coming into the game, both teams had one power-play goal in the playoffs and now they are a combined 2 of 33.

In the second overtime, the Pirates fired five shots on net in the opening five minutes with one solid scoring chance.

John McFarland tried a wraparound that was just wide, and Steven Hodges’ follow also was wide of the net.

In the first overtime, Hershey stormed the Portland net in the opening four minutes and fired four shots on net, but McKenna was solid.

The Bears continued their assault, but McKenna stopped a two-on-none breakaway with a stick save with 13 minutes remaining in the overtime.

The Pirates’ best opportunity came when Flick’s wrist shot in the slot was gloved by Peters with 1:05 remaining. Hershey outshot the Pirates 8-7 in the first overtime.

Hershey took a 1-0 lead when Nathan Walker scored his first playoff goal by beating McKenna with a wrist shot in the slot to his stick side at 5:27 of the second period.

McKenna had a busy first period, turning away 12 shots. His best effort was a glove save off a flipped shot right in front of the net with just over four minutes left in the period. McKenna then made two saves on a Hershey power play in the final minutes of a scoreless opening period in which the Pirates managed five shots.

The Pirates’ best chance came early when Connor Brickley broke free deep in the Hershey zone but was stopped on a breakaway by Peters.

Portland was the aggressor in the second period and outshot Hershey, 14-3. But a failure to take advantage of six power-play opportunities meant Portland had to continue to work from behind.