CAPE ELIZABETH — A little more than a minute remained in the Class B girls’ lacrosse semifinal, and Greely attackers swarmed around the Cape Elizabeth net, desperately seeking the tying goal. Freshman defender Laura Ryer tried to maintain her composure.

“I was pretty nervous,” she said. “I just kind of played my heart out.”

A pass came in front. The ball was bobbled and hit the turf. Ryer scooped it up, lost it after being checked, then regained possession and ran for her life, straight toward the Cape Elizabeth bench just beyond midfield.

“It was just all this excitement,” Ryer said. “It was crazy.”

Ryer’s mad dash secured a 9-8 victory Wednesday night at Hannaford Field for the No. 2 Capers, who managed to run out 75 seconds after thwarting Greely’s last-gasp effort.

The victory sends Cape Elizabeth (9-5) into the Class B final Saturday against top-seeded Yarmouth (12-2).

The Capers built an 8-4 lead at intermission on the strength of four goals from sophomore Karli Chapin, including a short-handed tally in transition that snapped a 3-3 tie. Susie Graham added a goal less than two minutes later, then twice set up Chapin in front.

When Cape senior Emily Healy made it 8-3 with 32 seconds left in the half, it seemed as if the rout was on. Instead, No. 3 Greely (9-5) responded with a goal by Katie Bennert, set up by Jayme Morrison, with 5.6 seconds left, and the Rangers roared out of intermission with three goals in seven minutes before Cape Elizabeth managed its first shot.

“Season’s on the line, so you know you have to take some risks,” Greely Coach Becca Koelker said. “Our defense knew that we were going to have to go out and pressure a little bit more instead of sitting back. I thought they did a fabulous job of executing that.”

Madison Sarka scored for the Capers to make it 9-7 with 9:33 left. Greely’s Morrison converted her own rebound with 2:14 remaining.

Courtney Sullivan won the ensuing draw for Greely, but the Rangers failed to get off another shot, thanks to Ryer.

“She doesn’t play like a freshman,” Cape Elizabeth Coach Alex Spark said. “She’s just a kid who is athletic and understands, you get the ball on your stick and you go.”

Cape goalie Erin Foley not only finished with nine saves, she also darted away from her crease to intercept three Greely passes, helping to mitigate the Rangers’ 12-6 advantage in draws.

“What I look for is eye contact,” said Foley, of passer and potential receiver. “If they don’t break eye contact for a few seconds, then I know it’s going to go there. Sometimes I’ll give myself away by coming out too far, but you just look for the eye contact and the body language.”