STANDISH — Justin Courtney lost his bid at a state championship no-hitter with just two outs to go. But the Bangor senior brushed that disappointment aside like it was a horsefly that had just buzzed in from nearby Sebago Lake.

The University of Maine-bound right-hander buckled down instead, racking up his ninth and 10th strikeouts, then braced himself for the dog pile in front of the mound as the Rams celebrated their first Class A state title since 2006 with an 8-0 win over Windham at Mahaney Diamond on the campus of St. Joseph’s College Saturday.

“The no-hitter didn’t matter. I just wanted to pitch well, throw my game,” Courtney said. “I felt like if I did that we’d be successful.”

“Right off the bat, I felt good,” he added. “Right when we stepped off the bus we had a good feeling. We just wanted to stick to what we’ve done all year. We’ve been pretty successful.”

Working on three days rest, Courtney walked three while throwing 86 pitches.

With his first pitch of the seventh inning, he appeared to have fate on his side when third baseman Sam Huston made a diving stab to his left on Spencer Hodge’s one-hopper and threw him out at first.

“I thought that might be the one to save the no-hitter,” Huston said. “But the next one was hit a little harder. I dove to my left and couldn’t come up with it.”

Ethan Petty followed with a sharp ground ball that eluded Huston’s dive and shortstop Kyle Stevenson’s diving attempt in the hole for a clean single.

“We went with our horse,” Bangor coach Jeff Fahey said. “We felt confident we could go with either our one [Courtney] or our two [sophomore Trevor DeLaite], but that was pretty dominant.”

Bangor (18-2) led 2-0 after one and 5-0 after three. Windham (11-10), which came out of Western A as the No. 11 seed, only threatened once.

Two walks and an infield error put Courtney in the stew in the fifth. He got Josh Dugas to ground out into a third-to-home force-out, then got Tyler Johnson to bounce into a first-to-home force.

“We made a couple of plays we didn’t have to make all year, and we had to do it twice in one inning,” Fahey said. “He pitched on three days rest and he was dominant, even when they put the pressure on.”

With leadoff Zach Conley standing between him and a clean getaway, Courtney threw three straight fastballs to get up 0-2 in the count, then froze Conley with a curve on the outside corner for strike three and put an end to Windham’s best scoring chance.

“The whole game, we were looking for that one big momentum-shifter and we just never got it,” said Windham junior Tanner Laberge, who pitched Windham into the title game by co-authoring a no-hitter Tuesday against Marshwood. “We couldn’t get that spark we were looking for.”

Bangor started the game with a spark as its first three hitters reached successfully via a double and two singles. Courtney, who had two hits, drove in the first run with a single to left.

Windham turned a 4-6-3 double play on Andrew Hillier’s grounder sending DeLaite to third. Huston followed with a grounder deep in the hole that popped out of shortstop Tyler Johnson’s glove on the backhand and beat the throw to first, scoring DeLaite to give the Rams a 2-0 lead against Windham starter Hodge.

“Our kids were fired up. We had a great week of practice. I just don’t think they were going to be denied,” Fahey said. “The first fastballs they saw, they ripped at. We were aware of what their pitching staff had done [in Western A] with the slider and the curve ball. They gave us a little bit of trouble a few innings, but when you have to rely on it, even a poor-hitting curve ball team can hit that.”

In the third, the Rams added three runs to the margin with a two-out rally. Courtney and Hillier ignited it with a single and double, respectively, then scored on Huston’s triple into the gap in right-center.

“Their coach called time to talk to their pitcher, so I talked to our coach and he said it was going to be the best hit all year,” Huston said. “It’s definitely up there. I’m definitely not going to forget it for awhile.”

Hunter Boyce followed with an infield single that scored Huston.

Bangor broke it open with three more in the sixth against Laberge. Johnny Cote’s RBI single, Jordan Derrah’s sacrifice fly and a wild pitch that scored Cote made it 8-0 Rams.

Bangor finished the season with an 11-game winning streak, six via shutout. Saturday’s shutout was their eighth of the season.

“Our pitching has been unbelievable all year,” Fahey said. “We lost one game, 4-3, and we got blown out in our first game. Other than that, we’ve won every game and haven’t given up many runs. And by the way, that’s Courtney’s fifth [shutout]. No other team in the East even had two.”

“We’ve got a great team. It couldn’t happen to a better group of guys,” Courtney said. “We’ve worked so hard for this day. It’s great to see it all come together, especially for the seniors. You can’t ask for anything more than your last game in a Bangor High School uniform to win a state title.”