Two thick green curtains separated Jack Tierney and Conner Sullivan from most of their Cape Elizabeth boys’ tennis teammates, but they had a sense of what was happening in the singles matches, hidden from view.

Should Tierney and Sullivan win their second doubles match, Cape Elizabeth would likely repeat as Class B state champion.

Thanks to one last winning volley from Sullivan, that’s exactly what happened. Tierney and Sullivan pulled out a 7-5, 7-5 victory over Camden Hills after Luke Gilman and Eli Breed breezed through singles matches to wrap up a second straight title Saturday night at the Racket & Fitness Center.

The Capers went on to a 5-0 victory in a match originally scheduled outdoors at Bates College, but moved indoors because of a wet forecast.

“We knew what was at stake going down the stretch, so it was big to wrap that up,” said Tierney. “Cape tennis has got such a big legacy. To be able to write our own chapter in that was kind of cool for us.”

Ethan Murphy and Jack Hall pulled out a three-setter at first doubles, 6-4, 5-7, 7-5. At No. 1 singles, Gabriel Torres won 6-1, 6-1 for Cape Elizabeth (14-2), whose only two losses came against Falmouth, which is scheduled to play for the Class A title Monday.

In the Class B girls’ state final, Greely completed the day’s Western sweep by rallying past Waterville 4-1 to win the first tennis title in school history.

“We’re getting our banner,” said Coach Ben Caswell, who had let his team know tennis was the only sport at Greely without such a trophy.

Waterville (15-1) won easily at first singles with Colleen O’Donnell (6-1, 6-1) but Greely (15-1) came back from first-set losses at both third singles (Alex Tebbs 3-6, 6-3, 6-3) and second doubles (Sarah Gooch and Sam Kennedy 5-7, 6-3, 6-4) to wrest momentum.

Anna Collins clinched the title with a 4-6, 6-2, 7-6 (7) victory at No. 2 singles over Emily Dufour of Waterville, who had jumped to a 5-3 lead in the third.

“I was sort of defeated when it was 5-3,” Collins said. “But I figured we still had a shot at it. I just kind of hung in there and got lucky. I think I faced two or three (match points), at least.”

The win by Collins gave Greely an insurmountable 3-1 lead. The first doubles match between Mia Lambert and Jessie Hoffman of Greely and Emma Cristan and Jayme Saulter of Waterville seemed headed to a third set after they split sets, each going to tiebreakers, in a match passing three hours.

After Collins clinched the overall victory, the first doubles participants decided to play a tiebreaker instead of a third set, and Lambert and Hoffman won it by a score of 7-5.

“With Falmouth moving up to Class A, we kind of knew all season we could get here,” said Gooch. “We knew nothing about Waterville except that we had to rise to the challenge.”

“It was evenly matched and good competition,” said Coach Jill Cristan of Waterville, Class B runner-up for the fourth year in a row.

“Just a matter of who was going to stick it out.”

In the boys’ match, Gilman at No. 3 singles was first off the court with a 6-0, 6-0 victory in which only the first game even reached deuce. Breed wasn’t far behind with a 6-0, 6-1 victory at No. 2 singles. They are the only holdovers from last year’s championship lineup.

“It’s tough when you lose the players we had last year, because we were so talented,” Gilman said. “But the addition of (Torres, a Brazilian exchange student) helped, and the guys who got the opportunity this year, they really stepped up. They’ve been solid all year in doubles and that really helped the transition.”

Cape Elizabeth Coach Andy Strout said he wasn’t sure what to expect from his team at the beginning of the season, particularly from seniors Hall and Tierney.

“They’ve been on the fringes for a few years, watching it all,” Strout said. “Now all of a sudden everything was thrust upon them, and they grabbed it and took off.”