YARMOUTH — For the Cape Elizabeth High girls’ soccer team, the situation was bleak Wednesday. A teammate had received a red card, Greely had just tied the Western Class B final on the ensuing penalty kick and the Capers were playing with a jumbled lineup due to injuries.

Their state-title reign was in trouble.

Except the Capers had no intention of being ousted. They had spent all season adjusting – to new players on defense, a well-intentioned but ultimately ineffective formation change, and most of all a lackluster start.

“We came into the season thinking ‘Oh, we’re defending champions, we’re going to stroll through the season like we did last year,’ ” said Kathryn Clark, a senior captain. “We got a reality check first week in and it’s been constant grinding ever since.”

Cape beat Greely 2-1 after penalty kicks with a combination of focused defense that mitigated the impact of Greely stars Jocelyn Mitiguy and Izzy Hutnak, and the calm assuredness with which Clark, Sarah O’Connor, Montana Braxton and finally Mariah Deschino converted penalty kicks.

Cape Elizabeth (12-4-1) will meet Waterville (17-0) in Saturday’s 12:30 p.m. state final at Deering High in a title-game rematch.

Cape will need all of its defensive skill. Led by Pilar Elias’ 31 goals, Waterville outscored teams 79-0 in the regular season and 11-2 in the playoffs. The Capers beat Waterville 2-1 on penalty kicks in the 2013 final.

Even before the red card for denying a sure goal forced the Capers to play against Greely with 10 players for what turned out to be the final 61 minutes, Cape already had shifted personnel multiple times. Defender Katherine Briggs tore her ACL in the semifinal. Her replacement, Melissa Rudberg, was struck in the head and showed concussion symptoms. That pushed Braxton to central defender, where she controlled the game with ample help from players like Brette Lennon and Sierra Aceto.

“I just looked around to my defenders and said, ‘Tell me what to do,’ and I just wanted to keep the ball out and work for my team,” said Braxton.

The adjustments epitomized what the Capers have done all season. Cape lost two of its first three games and was struggling against top teams at midseason with a 5-3-1 record.

Coach Craig Fannon had installed a new formation but then realized his club was better off going back to its standard 4-3-3, with Clark, Kate Breed and Deschino using speed up top.

Fannon pointed to Clark’s increased ability and willingness to play the full field as a testament to his team’s growth.

“This has been the biggest change to my season,” Fannon said. “She was always the one on the end of it scoring goals. She’d hang around up front and wait for the ball to come to her.

“But this year because we’re not as strong defensively, she has just sat in and still managed to get the goals, and the defensive side of her game has improved 100 percent.”

The Capers also kept the faith – during the season and Wednesday against the odds and Greely.

“Regardless of how we started out, we all just said we’re going to keep a positive mindset and we’re going to keep at it and keep working,” Braxton said.