FREEPORT — The Freeport boys’ soccer team let a two-goal lead slip away Wednesday evening against Cape Elizabeth in the Class B South final, but after 40 years in the wilderness, the Falcons weren’t about to let a regional title slip away.

With pressure mounting and the Capers gaining more confidence and momentum by the minute, Freeport sophomore Will Winter scored out of a scrum with 14:58 to play, and the second-seeded Falcons went on to a 3-2 victory over fourth-seeded Cape Elizabeth, winning a regional title for the first time since 1978.

Freeport improved to 12-3-2, ended the Capers’ season at 9-5-3, and advanced to meet Presque Isle (14-1-2) in the state final at 5:30 p.m. Saturday in Hampden.

“It’s something special for the school and the fans,” said Winter. “We had so many people here tonight. It’s just unreal.”

It took just one minute, 58 seconds for the Falcons to get the jump, as Ethan Prescott served a corner kick to the head of Shea Wagner, who finished for a 1-0 lead.

“That was huge to get the first goal,” Wagner said. “My role this year is just to get to where the ball will be in the air. I went for it and I saw it go in. It was a great feeling.”

Freeport doubled its lead with 18:02 to go in the first half when Wagner crossed the ball to the back post, where Eriksen Shea slid and tapped it past keeper Harry Baker.

“Coach (Bob Strong) tells us to always look for that back cut, that secondary run,” Shea said. “I was in the right place. My eyes got huge and I put it in.”

The Capers, who ended Yarmouth’s four-year state title reign in the previous round, cut the deficit to one before halftime, as Killian Lathrop finished a give-and-go with Calvin Stoughton with 9:20 left in the half.

Then, with exactly 24 minutes left in regulation, Nick Aceto set up Phil Tarling for a run up the left side, and Tarling beat Freeport keeper Atticus Patrick to tie the score.

“We did a really good job working our way back in the game,” said Cape Coach Ben Raymond.” We tied it up, and we thought we had momentum.”

Instead, Winter produced the winner with 14:58 left, somehow getting to a loose ball in the box and beating Baker (seven saves) for a 3-2 lead.

“I don’t even know what happened,” said Winter. “It came to me off a deflection and I sent it in.”

Patrick (six saves) punched the ball away off a late corner kick and the Falcons held on.

“I’m happy for the community, the school and these boys,” said Strong. “We’re going to enjoy it tonight.