LEWISTON — The Lewiston Blue Devils pressured Scarborough the whole game, and then turned it up a notch in the final 90 seconds.

“That’s what we tried to do,” forward Jeromey Rancourt said. “Get the puck on net and good things happen.”

The Red Storm could not clear the puck out of their zone, and Lewiston capitalized.

Keeping possession for over a minute, the Blue Devils got off a flurry of shots, capped by Rancourt’s rebound goal with 29 seconds left that gave Lewiston a 2-1 victory in the Class A boys’ hockey state championship game Saturday night at the Androscoggin Bank Colisee.

Rancourt’s goal caused an eruption from most of the standing-room-only crowd of about 4,000, as the Lewiston community celebrated the end of a 14-year championship drought. The Blue Devils (17-2-2) won their 21st title but first since 2002, ending a streak of six losses in state finals.

“It just all fell into place,” said Jamie Belleau, a 1989 Lewiston alum who took over as coach in 2008 after winning two state championships at Edward Little.

“Everyone knew this group of kids was special. We also knew we hadn’t won one for 14 years. For these kids to do what they did, with the added pressure, I can’t say enough about how proud I am to be part of this.”

Scarborough Coach Norm Gagne, who preceded Belleau as Lewiston’s coach and who has won seven state titles with three programs, gave Belleau an extra-long hug after the game.

“I told him he got the monkey off his back and I was proud of him,” said Gagne, who guided Scarborough to its first state championship in 2015.

Scarborough (16-3-3), which tied Lewiston twice during the regular season, got a goal from Jack Callahan and 31 saves from Ross LeBlond.

“When you play a one-goal game like we just played, it’s anybody’s ballgame,” Gagne said. “You’ve got to be able to minimize your mistakes, and they capitalized on two big ones.”

In the first period, the Red Storm turned the puck over at Lewiston’s blue line, and the Blue Devils pounced for a three-on-two rush. Rancourt passed to Alex Rivet, who fired a pass to Joe Bisson at the back door. He buried it for a 1-0 lead at 10:17.

Scarborough scored the equalizer 33 seconds into the second period. Eric Murray fed Callahan to start an odd-man rush. Callahan skated down the left side, saw an opening and fired a shot past Lewiston goalie Jacob Strout.

Scarborough lost Callahan with two minutes left in the second period when he was cross-checked and fell back into the boards, hitting his head. After being tended to, Callahan skated off the ice, and returned to the bench only as a spectator.

“When we lost Jack off our top line, we were piece-mealing from there,” Gagne said.

Lewiston outshot the Red Storm 33-15.

“They were dominant in places, but we were still in the game,” Gagne said.

But after a faceoff in the Scarborough zone with 1:36 left, the Blue Devils kept control for over a minute.

“We just couldn’t get it out of (the zone),” Gagne said, citing his team’s second big mistake.

Jonathan Sturgis sent in a slap shot that LeBlond blocked. Rivet swatted at the rebound, but LeBlond was there. Then the puck went straight to Rancourt, who had an open net.

“I was right there, my mind went blank, and I put it home,” said Rancourt, who immediately skated toward the Lewiston fans to celebrate.

“There’s a great tradition here. I’m glad we could do it.”

Soon, the Blue Devils were all over the ice celebrating, and Gagne was gathering his players in the locker room.

“I’m proud of the kids. They gave everything they had,” he said.