Abby McInerney took 12 years of tortured history and stuffed it into the back of a lacrosse net Saturday.

Her goal with 16 seconds remaining gave Cape Elizabeth a 9-8 victory in the Western Class B semifinals and, perhaps more importantly, brought an end to a Waynflete dominance that was wearing on the Capers.

Waynflete, the two-time defending state champions, had won 24 consecutive games against Cape Elizabeth.

“I don’t think I’ve ever been happier,” said McInerney, a senior who scored six goals. “Everyone thinks, ‘Oh, Cape’s playing Waynflete again, they’re going to lose again.’ And with good reason. And so we just wanted to prove that we could do it. And being able to finally do it is the best feeling in the world.”

The third-seeded Capers (10-4) were loud and loose on the ride to Portland, said Coach Jeff Perkins, who wanted them to believe that all the pressure was on second-seed Waynflete (8-5).

“They don’t want to be the first team that loses to Cape Elizabeth,” the eighth-year coach reassured his team.

The Capers had lost decisively to Waynflete 10-5 in the season finale June 6. But a quarterfinal win over Falmouth restored confidence, McInerney said.

Cape Elizabeth jumped to a 4-1 lead, but the Flyers, getting three goals from Leigh Fernandez, reclaimed an 8-6 edge late in the second half.

“After they scored that, I was thinking, ‘Here we go again.’ And as soon as I thought that, I said, ‘You can’t think like that,’ ” McInerney said. “We didn’t want to have any regrets. We didn’t what to have anymore what-if games, which we’ve had against them for 24 games in a row”

The Capers, who got 12 saves from goalie Kate Bosworth, battled back to tie the score, then gained possession with 2:30 left. They stalled until there were only 16 seconds on the clock, when Liz Robinson rifled a pinpoint pass from behind the net that McInerney raced in to catch and shoot in one motion.

“I was looking for open players on the top and I saw Abby,” said Robinson, who assisted on four of McInerney’s six goals. “When she scored that goal, my heart literally dropped. I was like, ‘That went in! That was so awesome!'”

Said Waynflete Coach Cathie Connors: “They just pulled off a great play. We prepared for it, but we weren’t able to stop it.”

McInerney wasn’t going to be stopped on this afternoon.

“I didn’t even aim; I just shot and hoped for the best,” she said. “I just saw that it went in and it was unreal. I don’t think I could picture that in my wildest dreams.”

Thanks to McInerney, the Waynflete nightmares are over for Cape Elizabeth. Next up is a rematch with Kennebunk in the Western final on Wednesday.