University of Maine's Luke Antonacci is shown in a Jan. 13, 2023 file photo.

The University of Maine’s hockey team displayed some character by rallying from a 4-0 deficit to tie fifth-ranked Boston University 5-5 in the second period of Saturday night’s game at Agganis Arena in Boston.

But the Terriers got a fluke goal late in the second period to break the tie and added three consecutive goals in the third period to pull away from the Black Bears for a wild 9-6 victory.

It is the most goals allowed by the Black Bears since a 9-5 loss at UMass Lowell on Jan. 4, 2021, and the most scored by the Terriers since they notched a 9-3 home win over UMass Lowell on Dec. 9, 2017.

BU improved to 17-6 overall and 11-4 in Hockey East while UMaine fell to 9-12-2 and 3-8-1, respectively.

The six goals were the most scored by UMaine in a game this season.

“It was a bizarre game,” said UMaine head coach Ben Barr. “It’s a little bit humbling. It was a tough one to watch as a coach. It was probably fun to watch if you were a fan.

“We have been a pretty good defensive team for most of the year. But BU did whatever they wanted. That’s what a good team can do to you if you play loosely (defensively) and don’t take care of the puck. It would have taken a goaltender to have the performance of his life to keep BU to just four or five goals tonight.

“We got what we deserved,” Barr added.

The Black Bears had allowed three goals or less in 16 of its first 21 games before giving up five in Friday night’s 5-1 loss to BU and the nine on Saturday.

As it did on Friday night, BU took the lead in the first two minutes of the game.

Wilmer Skoog took a pass from Devin Kaplan and fired a shot past Victor Ostman just 36 seconds into the game.

He scored again 3:52 later, his ninth of the season, and Matt Brown’s 11th made it 3-0 at the 7:56 mark on the power play.

That ended Ostman’s night as he allowed three goals on seven shots and was replaced by Connor Androlewicz, who surrendered a goal to freshman defenseman Lane Hutson at the 14:45 mark, Hutson’s ninth.

But the resilient Black Bears rallied for three goals in a span of 2:22 to pull within one at the intermission.

Donovan Houle scored a power-play goal at the 17:32 mark, his sixth of the season; Ben Poisson collected his sixth just 17 seconds later and freshman defenseman Brandon Chabrier picked up his first collegiate goal with six seconds remaining in the period.

BU’s Jeremy Wilmer made it 5-3 with his fifth of the season 2:41 into the second period but UMaine tied it on Lynden Breen’s ninth and Didrik Henbrant’s third at the 5:54 and 7:49 marks.

Reid Pabich had apparently given UMaine a 6-5 lead midway through the period but BU coach Jay Pandolfo challenged the goal and it was overturned due to goaltender interference.

Barr contested a BU goal on a goaltender interference platform on Friday night but it was upheld.

“If that one tonight counted, last night’s shouldn’t have counted,” said Barr.

Sophomore defenseman Ty Gallagher gave BU the lead for good at the 13:09 mark when his wrister from the midpoint apparently deflected off a UMaine player and floated past the screened Androlewicz.

Quinn Hutson made it 7-5 at the 2:26 mark of the third period when he converted a breakaway off brother Lane’s pass into his ninth of the season.

Power-play goals by Wilmer and Luke Tuch, who each scored their sixth goals, made it 9-5 before UMaine’s Nolan Renwick completed the scoring with a power-play goal. It was his fifth of the season.

UMass Lowell transfer Brown had a goal and three assists, his third four-point game of the season; Jeremy Wilmer and Wilmer Skoog had two goals and an assist each and the Hutson brothers had a goal and two assists each.

Drew Commesso allowed five goals on 17 shots before Vinny Duplessis replaced him in the second period and finished with nine saves on 10 shots.

Breen, Houle and Renwick had a goal and an assist apiece for UMaine while Jakub Sirota and Michael Mancinelli had two assists each. Androlewicz made 23 stops and allowed six goals in relief of Ostman.

“You have to have a lot of energy and play a very detailed game to beat a team like that and we were nowhere near that although some our guys played well and it was nice to see us score a pair of power-play goals,” said Barr whose team scored more than one power-play goal in a game for just the second time this season..

UMaine went 2-for-4 on the power play but BU was a perfect 3-of-3.

Boston Bruins coach and UMaine Sports Hall of Famer Jim Montgomery, the school’s all-time leading scorer with 301 points and the captain of the 1992-93 team that won UMaine’s first NCAA title, addressed the team before the game.

Up next: UMaine hosts Providence on Friday and Saturday nights at 7 while BU plays a home and home series with Boston College.