BRUNSWICK — Build around a nucleus of proven, experienced upperclassmen, blend in some multi-talented youth, and combine quality with quantity. There you have it: the basic recipe for success used by the Bangor Rams.

Head coach Phil Emery’s Bangor boys followed that formula almost to a “T” and won their fifth consecutive Class A state swimming and diving championship Tuesday night at Bowdoin College’s Greason Pool.

Even the graduation losses of 14 seniors from last season failed to end Bangor’s run.

“No, I honestly never expected to be in this position again after what we lost,” said Emery, who now has 25 state titles in his 42 years as Bangor’s coach. “But we really had a lot of guys step up who didn’t place in states last year, a great core of juniors, and a lot of added depth from our sophomores and freshmen.

“It became apparent we’d be in the thick of it around New Year’s because the depth started developing and the new kids were maturing.”

The Rams finished with 328 points to outdistance runner-up Cape Elizabeth, which scored 260. Windham wound up third at 234.

Bangor came into the meet well-positioned to do some damage with 18 of 35 team members qualified to swim in at least one state race. Of those 18, 16 qualified to swim either in consolation or championship final swims or dives.

“Today there were a lot of big bullets out there for us today, but it was mostly buckshot and we avoided it,” Emery said.

The Rams carried the momentum gained from a strong showing in the day-long preliminary swims by charging out to a second-place finish in the first event of the evening finals: the 200-yard medley relay. Matt England, Sam Barnett, David Smallwood and Isaac Carson shaved more than a second off their season’s best seed time with a time of 1 minute, 43.33 seconds, but still came up second to Windham, which also cut more than second off while swimming a blistering 1:41.88.

“The relay helped our nerves, but there are nerves all through this meet and we have the expectations to step up and be top dog because of this streak,” said Carson, who said the most exciting part of the meet for him personally was slicing a full 3 seconds off his best time in the 100 freestyle. “It’s not really stress so much as excitement. You just get really pumped up and you can’t wait to go.”

Windham led after the first and second events, but Bangor went from trailing by 12 after the 200 free to leading by seven after the 200 individual medley and never gave up the lead.

Just a freshman, Smallwood continued providing the points, nabbing a sixth-place finish and 13 points in the 50 freestyle plus a third place (16) in the 100 butterfly. He also swam the anchor leg of Bangor’s third-place 200 free relay team.

Barnett (lead leg of 200 free relay) also won the 100 breaststroke (worth 20 points) with a personal-best time of 1:02.15 and added a fourth-place finish and 15 points in the 200 IM.

“There have been times when it’s been pretty hard, especially after last season and losing so many good seniors,” said Barnett. “We had a lot of people step up, including freshmen, and continued to come together all through the season.”

Carson, who swam the third leg on the 200 free relay, also chipped in with an eighth in the 50 free and sixth in 100 free.

“When last year’s senior group left, we thought we were in pretty rough shape, but all of these guys really came together,” said senior co-captain Isaac Walton. who was ninth in both the 200 IM and the 100 breaststroke.

Junior Jeff Rogers swam third on the 200 free relay team and also notched a fifth in the 200 free and a sixth in the 500 free.

Brewer diver Ryan Boothby threw a scare into the crowd when he hit both his back and his head during his next-to-last dive in the 1-meter finals. The entire Greason Pool gallery, from fans to officials watched in shocked silence as the junior went underwater after clearly hitting himself on the board. The quiet turned to nervous applause after he came back up and swam over the side, shaking his head as he clambered up onto the deck.

Boothby was checked out by coaches, officials and medical personnel. He was bleeding slightly from scrapes on his back, but said he felt fine and wanted to continue, but officials wouldn’t allow him to do his last dive because he was having difficulty counting backward from 100 in increments of seven. Brewer coaches protested, but Boothby was disqualified. He was ninth out of 12 divers after the injury-marred dive, but was sixth before the start of the championship finals.

Boothby’s parents took him to Parkview Hospital in Brunswick to get him checked out.

Massabesic High School of Waterboro won the sportsmanship award and Cape Elizabeth junior Marcus Cloutier, who won the 200 IM and 100 free, anchored the winning 200 free relay team, and swam third leg of Cape’s second-place 400 free relay.

Other local standouts were Brewer’s Josh Williams, who was third in the 100 backstroke and fourth in the 500 free, and teammate Spencer Warmuth, who was fifth in diving.