BANGOR — Near the end of Saturday afternoon’s game against top-seeded Mount Desert Island, Gardiner coach Mike Gray turned to his players on the bench and said, “Girls, I’m so proud of you.” It was the way you would expect the No. 9 seed to end the game: Nice job, girls. Let’s build on this for next year.

Funny thing, though, this wasn’t like that at all.

When Gray told his players he was proud of them, he was shouting. He had to shout, because the Gardiner fans behind him were delirious. The Tigers shocked unbeaten MDI, 62-50, in an Eastern B girls basketball quarterfinal at the Cross Insurance Center.

“We knew we’d have to be on our A game to beat this team,” said Gardiner senior guard Morgan Carver, who hit four 3-pointers and scored a game-high 24 points. “It took every single one of us to win, and I’m really proud of everybody. There was no pressure on us, obviously. Not many people know what we’re capable of, and I think we just proved it.”

“I’ve said over and over again: I really don’t think that anybody knows how good we are,” Gray said. “Except maybe us.”

Gardiner (9-11) moves on to the Eastern B semifinals against No. 4 Camden Hills, at 3:35 p.m., Wednesday at the Cross Center.

MDI (18-1) came in not only as the No. 1 seed, but with 14 of its 18 wins by at least 20 points. Funny things started happening early, though. The Trojans had their shots spin out, and Gardiner led 3-0 when Carver banged home a three with 6:32 to go in the first quarter. Then it was 6-0 on a three by Logan Granholm. Then Granholm scored again, it was 8-0, and MDI was calling timeout.

“Getting that early lead, and showing them that it’s going to be a game definitely made them take a step back,” Carver said.

With Granholm (15 points) hitting shots from everywhere, the Tigers pushed their lead to 12-2 and 14-4. Everything was coming together for Gardiner, and it was stunning.

“We needed that start,” Gray said, “because all year long we’re down 10 points early, and then we’re the team that fights, and battles, and doesn’t give up, and makes it close. Tonight, we had to battle to hold on, rather than battle to get back in it, and it’s just a whole different energy level when you’re on the side that’s already ahead.”

Behind reserve guard Darcy Kanu, the Trojans regained their composure and trailed only 14-13 at the end of the first quarter. After starting 0-for-7 from the floor, MDI made six of 10, and it looked like the favorites were going to shake off their cobwebs and roll to the win.

But when Carver knocked down another three with 4:54 to go in the second quarter, Gardiner’s lead was back to 22-15. The Trojans went with a half-court trap and hustled to contest every pass, but that led to fouls as much as steals. The Tigers led 27-21 at halftime.

Gardiner came out blazing in the second half, scoring the first 12 points of the third quarter. The Tigers fans were pumped when Mary Toman (12 points, 14 rebounds) scored five quick points, went to another level when Carver hit a fast-break shot and drew a foul, and went nuts when Carver dropped in a 3 to make it 39-21.

Gardiner eventually led by 21 (49-28) and the Trojans were in a panic the rest of the game. MDI went with a full-court press, but while it led to a few turnovers, it also led to some uncontested layups when Gardiner got behind everyone. One play demonstrated this as much as any other: Late in the third quarter, Granholm appeared to be hemmed in by the sideline by two MDI defenders. Instead, she raced away from them, and made an open layup.

“We’re going to commit turnovers every now and then — we know that,” Gray said. “But when we handle the press, rather than settling — ‘Oh, we broke the press. Let’s set up in halfcourt.’ — we were aggressive.”

Gardiner point guard Lauren Chadwick was a big part of the Tigers’ success against MDI’s pressure. Chadwick, who made first-team all-Kennebec Valley Athletic Conference Class B, scored only two points, and both were on free throws in the final two minutes. But the sophomore pulled down 10 rebounds, and handled Gardiner’s offense about as well as anyone could.

MDI made its last stand in the fourth quarter behind Kelsey Shaw, who willed the Trojans back into the game with 20 points and 16 rebounds. The frantic Trojans fired up 25 field goal attempts in the fourth quarter, and were within 52-40 with 4:46 to play. But Shaw fouled out, and Gardiner had one of its most memorable wins ever.

“We go into the game not knowing what’s going to happen,” Carver said. “We get to halftime, and we say, ‘We have 16 minutes left.’ And at the end, you just don’t even know what to feel. It’s just so amazing.”

“You know, we were 4-8,” Gray said. “It would have been really easy to pack it in and say, ‘Geez, we’ve lost all these close games.’ But every day, they keep battling. They came out today, and bought into everything the coaches told them we needed to do for the week, and really just put it all together in one day. I’m so proud of these girls for coming as far as we’ve come this winter.”