SOUTH PORTLAND — South Portland pulled off a magical finish on Wednesday to reach a state championship game in boys’ lacrosse for the first time.

The Red Riots conjured up three goals in the final 48 seconds of regulation as Duncan Preston scored with 1.9 seconds left for a 12-11 victory over Thornton Academy in the Western Class A final at Martin Memorial Field.

Top-seed South Portland (13-1) will play Eastern Maine champion Brunswick, which defeated Cheverus 9-8 in the other regional final, at 5:30 p.m. Saturday at Fitzpatrick Stadium.

Thomas Leddy and Jack Fiorini led the Red Riots with three goals each, and Ben Bilderback had a goal and five assists. T-Moe Hellier made eight saves.

“I’m heartbroken that we both can’t go on,” said South Portland Coach Tom Fiorini. “(Thornton) is an incredible team and they deserve to go on as much as we do.”

Cody Falton (four goals) and Isaac Sinclair paced the No. 3 Trojans (11-4), who defeated four-time champion Scarborough 13-4 to reach the regional final for the third time in five years. Senior goalie Jack Grondin made 18 saves.

Thornton Academy had the momentum late in the third quarter and the first half of the fourth, scoring four straight goals to build a 10-8 lead with 6:16 to go. That run countered South Portland’s four-goal burst in the third quarter.

The Riots’ Leddy and the Trojans’ Falton traded goals to leave Thornton with an 11-9 advantage.

Much of Thornton’s success started with the dominating play of Sam Legere, who won eight straight faceoffs.

“These kids are not going to quit,” Fiorini said. “They proved it again tonight.”

The Riots’ Kameron Andrews scored from in front with 48.7 seconds to play to cut the lead to one, 11-10. That’s when South Portland asked officials to inspect Legere’s stick. It was deemed illegal, and he came off the field to serve a 3-minute penalty.

“We checked it at the beginning of the game, and in the process of winning seven or eight (draws) in a row, it got warped,” Thornton Academy Coach Ryan Hersey said. “I know he’s upset, but without him we don’t get back in that game. It was one those things. He didn’t do it on purpose.”

That change at center mid cleared the way for Preston.

On the restart, Thornton’s packed defense made finding an open shot difficult. Preston saw Andrew Whipple at the back post and sent the ball toward the cage. Leddy poached the pass and put the ball in to tie it at 11 with 6.9 seconds left.

“Duncan’s the kid, when something special needs to happen, you want the ball in his stick,” Fiorini said. “That’s what we made sure of at the end.”

Preston won the ensuing faceoff and ran the ball in himself, scoring on an underhand bounce shot that caromed up under the crossbar with 1.9 seconds to go.

“I told myself I’ve got to win this faceoff, go down and put this game behind us,” Preston said. “As soon as I hit the blue line, no one stepped to me, and I said ‘I’m going.'”

Two thoughts seemed foremost for the Red Riots after the game. First was mention of Ted Hellier, the middle school lacrosse coach who died a year ago after a battle with cancer.

“He’s looking down on us, crying,” Preston said. “He’s so proud of us.”

The second thought?

“This feels good,” Leddy said. “But our work is not done yet.”