LEWISTON — It wasn’t simply that nine years had passed since the Cape Elizabeth girls won a state title in tennis.

For a program that reigned supreme in Class B from 1990-98, it was that the Capers had not even reached a state final since 2007.

“Going into the land of the unknown was a little scary,” said sophomore Katie Gilman, “but we had confidence in each other.”

Gilman provided the clinching point at No. 2 singles to give Cape Elizabeth a 4-1 victory over Camden Hills in the Class B state final Saturday at Lewiston High.

“The journey is what counts,” Gilman said, “but it’s still exciting that we ended up winning.”

The Camden Hills boys ended an even longer championship drought, dating to 2005. They edged three-time defending champ Cape Elizabeth 3-2 after losing in the final the previous two springs.

“This was potentially the last competitive tennis match I’ll ever play,” said Camden Hills senior Luke Burnstein, whose 6-2, 6-4 victory at No. 2 singles set the stage. “So to win a championship against Cape in the same place where we’ve lost in the past was just amazing. I am so happy.”

After Burnstein won, Shawn Albertson and Josh Pitcairn made it 2-0 for Camden Hills with a 6-4, 6-3 victory at second doubles.

Knowing that Michael Mills was likely to win at No. 1 singles for Cape Elizabeth (which he did, 6-2, 6-1), the Windjammers (14-2) knew that they needed a clincher at either No. 3 singles or at first doubles.

In each match, they won the first set and struggled in the second. Wyatt Newhall and Declan McCormick of Cape Elizabeth forced a third set at first doubles and wound up winning, 3-6, 6-4, 6-4.

It was too late. Josiah Krul of Camden Hills survived two set points to force a tiebreaker and prevailed against Jimmy Salerno at No. 3 singles, 6-2, 7-6 (2).

“My only thought was to get the ball back and keep grinding,” Krul said. “It was more a matter of who would collapse first than who would win the point.”

“He just outrallied me,” Salerno said. “On those set points, I think I was trying to overhit in order to save energy for a third set.”

Camden Hills shut out Cape Elizabeth (13-3) in a preseason scrimmage, but the Capers had been without Mills, a semifinalist in the state singles tournament.

“So we knew those scores weren’t accurate,” Krul said. “They’re a great team, a great program, but so are we. To be on the winning side is unreal.”

None of the girls’ matches went three sets. Gilman won 6-3, 6-2, Liv Clifford won 6-2, 6-0 at No. 1 and Erin Whitcomb won 6-2, 6-2 at No. 3.

“It’s incredible,” Whitcomb said. “We haven’t been that good in the playoffs in the past. So to finally win it is pretty nice.”

Sarah O’Connor and Maddie Bowe were first off the courts with a 6-2, 6-1 victory at first doubles. Vivian Priestly and Charlotte Messer of Camden Hills avoided the shutout by winning 7-6 (3), 6-4 at second doubles.

Both teams finished 13-3.

“These girls deserve this,” said Cape Elizabeth Coach Sarah Boeckel. “They worked really, really hard all year and I think their play today showed that.”