CAPE ELIZABETH — Cape Elizabeth went from having a five-goal halftime lead to being a visibly relieved winner Tuesday night.

The Capers managed to keep their perfect season intact, but not before withstanding a monumental scare from Greely and settling for an 8-7 victory in a Western Maine Conference girls’ lacrosse game.

“We beat them by a lot in the first game (19-8 to open the season) so I think we kind of thought it was in the bag,” said Cape goalie Elin Sonesson.

Cape Elizabeth looked in control with an 8-3 halftime lead.

“I don’t really know what happened,” said Hannah Newhall, who scored two first-half goals for the Capers (6-0). “We started off really well and then we stopped getting draw controls and we stopped going for ground balls. It was like we couldn’t figure out the offensive part.”

The Rangers (1-4) used tight defensive stands and clutch saves by Mary Morrison to shut down the Capers in the second half. Cape Elizabeth, which averaged 16 goals in its first five games, was scoreless in the second half.

“I think the defense was sliding faster to help each other out (in the second half). I think that was huge,” said Greely Coach Sara Dimick. “And our goalie had a stellar performance and had saves consecutively toward the end. I think that really was the backbone to our second half.”

While the defense held Cape, the Rangers slowly chipped away. Goals by Paige Tuller, Audrey Parolin, Teal Otley and Meagan Labbe made it a one-goal game and set the stage for a pair of late chances to tie.

Both came in the final 10 seconds on free-position opportunities awarded to Julia Mitiguy right in front. Mitiguy never got a shot through on the first chance, but a second foul was called and Mitiguy was awarded another chance. This time she was foiled by Sonesson.

“They went in hard (on defense on the first chance), and obviously on that last one Elin just stood tall and did what she’s been doing for years for us,” said Cape Coach Jeff Perkins. “It was just a phenomenal save.”