LEWISTON — In December, Cape Elizabeth beat Greely in overtime.

Fast forward nearly three months and the two best teams in Class B South finally met again in Tuesday afternoon’s regional final at the Colisee.

The game was tight, well-played and decided in the third period.

One year after losing to York in overtime in the Class B South final, Greely prevailed by a goal, 3-2, thanks to a third-period goal from Jake MacDonald. The Rangers advanced to Saturday’s Class B state final against Old Town/Orono, which advanced with a 6-1 win over Presque Isle in the North final.

“This was a battle,” said Greely Coach Barry Mothes. “Two teams who had really good regular seasons. We were hoping to get another game with them and if we did, we knew it would be here.”

With 9:27 remaining in regulation, Greely’s Andy Moore just missed a shot wide, Jackson Williams kept the puck alive and MacDonald managed to bang it home.

“I was just coming down and I knew it was tied, so I just wanted to throw (the puck) on net,” said MacDonald. “I came off the goal line, flipped it and it went off (the goalie’s) shoulder and went in.”

Greely’s Matt Kramlich hit the post in the first period, but no one scored, as Karsten Bourgoine made 12 saves and Cape Elizabeth’s Peter Haber stopped nine shots.

The offense showed up in the second period, in conventional and unconventional ways.

After Ryan Collins took a shot while falling to his knees that Bourgoine saved, Alex Glidden was there to bang home the rebound for a 1-0 Cape Elizabeth lead at 2:35.

The Rangers pulled even at 7:20 as MacDonald took a pass from Williams and fired a shot that Haber slowed only enough for the puck to agonizingly roll across the goal line.

At 8:30, Greely took a 2-1 lead as Kramlich stole the puck and beat Haber top shelf.

The Capers then answered at 10:20 as Gavin Simopolous won the puck behind Bourgoine and shot the puck off the goalie and in to make it 2-2.

The Rangers got the go-ahead goal at 5:33 of the third period and the goal came with some controversy, as the net came unhinged. After a video review, the goal stood and Greely had the lead for good.

“I didn’t see the goal come off,” said MacDonald. “I was confident (it would stand). It really got the bench going and gave us momentum.”

Down the stretch, Bourgoine made two more key saves, giving him 28 for the game, to help close it out.

“It’s unreal to come out with a win,” Bourgoine said. “The team played really hard. I just focused on the game and didn’t let them get in my head. I just had to stay positive.”

Greely won Class B state titles in 2009, 2012 and 2013 and lost in 2007. The Rangers are seeking the school’s sixth overall championship this winter sports season.

“It’s fun to have a couple more practices and stand here on the final Saturday,” Mothes said. “We’ll try to keep doing the good things we’ve been doing. We still have things to tighten up. We’ll try to win three periods. I’m sure it will be a really challenging game.”

The Capers (15-3-2) finished with a 30-29 advantage in shots and got 26 saves from Haber.

“This one really stings,” said Cape Elizabeth Coach Matt Buotte. “The tough thing about high school hockey is that it doesn’t matter what you do for three-and-a-half months, you have to do it for 45 minutes. Unfortunately, tonight, (Greely) got the extra bounce.

“This group of seniors, all seven of them, were three-year varsity players, some of them four. There are no platitudes I can give to explain what these guys did for this program.”