SACO — The Portland Pirates played the last game of their season Saturday night on the ice where they’ve spent the most time this season, but it didn’t make any difference.

The St. John’s IceCaps scored three third-period goals to pull out a 5-4 victory as the Pirates finished the season with an 11-game winless streak and the worst record in the AHL.

Coach Ray Edwards called it “a microcosm of all our games.”

The Pirates held a 2-0 lead at the end of the first period before losing momentum.

“Penalties got us in trouble,” Edwards said. “We took four minors in the second period that cost us our momentum.”

Because of a schedule conflict with the Shrine Circus, the season finale was switched from the Pirates’ one-season home at the Androscoggin Bank Colisee in Lewiston to the MHG Centre, their practice facility.

The game drew a standing-room crowd of 550, considerably less than the average of 2,229 fans the Pirates drew in 37 games at the Colisee. The team, which will return to the Cumberland County Civic Center next season, finished last in attendance in the league.

The Pirates (24-39-3-10) finished last in the league for the first time in their 20-year history.

“It was a difficult year in a number of areas, and we certainly share responsibility,” said Don Maloney, general manager of the NHL parent Phoenix Coyotes.

“I don’t look at our coaching staff and our training staff and blame them. I thought they did the best job they could under the circumstances between the call-ups and injuries.”

The Coyotes and Pirates still haven’t completed work on a new affiliation agreement.

“Our agreement is up but we have a very good relationship (with the Pirates’ ownership) and we hope we extend it at least for a year and then see where it goes from there,” Maloney said. “We want to be here. They want us. It will get done.”

The Pirates won just 10 games at the Colisee to pass the previous franchise low for home wins. During the 1998-99 season, they won 13 games at the Cumberland County Civic Center.

The Pirates, who wound up with 61 points, avoided new lows in points (55) and longest winless streak (13).

“We didn’t do a good enough job, simply,” Edwards said. “What did we do wrong? What do we have to do better? There’s a lot of things. We’ll take the next couple of weeks and we’ll do the postmortem on it. We’ll figure it out.”

The Pirates took a 2-0 lead in the first 15 minutes on defenseman Brandon Gormley’s seventh goal of the season and rookie right wing Tobias Reider’s 28th goal.

After Kael Moullierat scored two goals in the first 10 minutes of the second period to tie it, right wing Brandon Yip scored a short-handed goal to send the Pirates into a 3-2 lead.

The IceCaps moved into a 4-3 lead when Jerome Samson and Josh Lunden scored in the first 10 minutes of the third period.

Yip made it 4-4 when he put in a penalty shot with six minutes left, but Lunden scored his 22nd goal moments later to put St. John’s back into the lead for good.

“We fought back and tied it, and then the next shift we defend like a peewee (team),” Edwards said.