GORHAM — Jena Leckie came off the bench for the South Portland girls’ lacrosse team and scored one of the biggest goals in school history in Wednesday’s Class A South quarterfinal matchup against Gorham.

With 3.7 seconds left in regulation, the freshman midfielder found the back of the cage to tie the game, setting the stage for the No. 5 Red Riots to come from behind to beat the fourth-seeded Rams, 11-10, in double overtime.

South Portland advances to a Saturday semifinal against Marshwood.

“South Portland had never won a first-round playoff game. Ever,” said Red Riots Coach Leslie Dyer. “We came into this year and one of our goals was getting past this round.”

Trailing by a goal late, South Portland took a timeout after forcing a turnover in its defensive zone. Kayla Brown then capped some impressive ball movement, connecting with an open Leckie, who fired a low liner off the ground and into the net.

“On the possession before, my whole team was telling me not to shoot high, and of course I shot high,” said Leckie. “I learned from it and when I ended up with the ball, I knew my team was relying on me to score there. I just calmed down, aimed at the goal and it went in.”

Leckie’s tying score built momentum that South Portland carried through to overtime. Despite controlling the ball in the offensive end for most of the first 3-minute overtime, the Red Riots weren’t able to find the back of the cage.

“They were able to ride that momentum,” said Gorham Coach Mary Vaughan. “I was pleased we were able to hold them off for those three minutes but I knew they had the momentum going into it, and we just didn’t seem to be able to come back from the goal with three seconds left.”

After winning the opening draw of the second overtime, South Portland senior Maddie Hasson raced downfield, weaving between defenders.

When Gorham’s defense collapsed to try and slow the standout scorer, she found an open Mary Cronin, who buried her second goal of the game just 12 seconds in to give the Red Riots the victory.

Hasson shouldered most of the offensive load for South Portland (8-5), pouring in a game-high six goals.

Kaya Backman and Molly Walker also scored goals for South Portland, while goalie Zoe Brown turned away 14 shots.

Marina Pappalardo paced Gorham (7-6) with five goals, while Emma Smith, Amelia Pappalardo, Audrey Perrault, Jen Darasz and Athena Pappalardo each scored once.

Allison Sinnett made 15 saves for the Rams.