The Bulldogs created a “miracle moment” on Tuesday night as San Rafael High clinched a berth in the MCAL boys basketball playoffs for the first time in nearly a decade.

“I told the team all year that we would play our best at the right time,” said first-year San Rafael head coach Colin Hamilton after the Bulldogs held off a furious rally from San Marin, 65-63, at Dominican University in a must-win game for both teams.

Luke Shapiro played perhaps his best game for the Bulldogs in the third quarter, when he hit four 3-pointers and scored 16 points to hold off a Mustangs comeback. Shapiro finished with a game-high 25 points and four rebounds as San Rafael punched its ticket for the MCAL playoff field for the first time since the 2017-28 season.

“This means so much, for our seniors, for everyone who’s played so hard,” said senior Gio Brovelli, who added 16 points and six rebounds as the driving force behind the Bulldogs (16-8, 3-4 MCAL).

“We had some tough losses, and I told them, ‘That’s OK, when it matters most, we’ll have our March Madness moment’,” Hamilton continued. “I talk to them all the time about being that team that no one expects to make the Final Four, that has that miracle moment. Tonight was a March Madness win.”

That moment could have belonged to San Marin, which was looking for its own miracle in the final seconds of the game. After San Marin junior Grant Means missed the second of his two free throws, teammate Miller Morgan grabbed the rebound and San Marin set up for the final shot of the game, trailing 64-63 with 28 seconds to play. Senior co-captain JD Rhodes sent the ball into the corner for Means, who drove to the hoop only to find his path blocked by the Bulldogs’ Will Healy. The call went in favor of San Rafael, effectively sealing the outcome.

The loss knocked San Marin (12-12, 2-5) out of contention for the league playoffs for the second year in a row.

The Mustangs were an uncharacteristic 7 for 15 from the free-throw line, which head coach Chris Lavdiotis admitted “really cost us,” although he felt the Mustangs should have gone to the free-throw line more often.

Means, who was held scoreless in the first quarter as the Mustangs crawled out of the game, finished with a team-high 23 points. Rhodes added 15 points and Morgan had 12. Senior co-captain Zach Farbstein had 11 points for the Mustangs.

San Rafael led the entire game and showed no signs of letting up as the Bulldogs led 34-25 at halftime.

“That was not the game plan at all,” Lavdiotis said after the Mustangs fell behind 8-0 to start the game.

But the game changed as the Mustangs mounted a series of comebacks in the second half. San Rafael was in need of a pick-me-up in the third quarter, and Shapiro answered the call.

The Mustangs closed to within two points on a basket by Rhodes midway through the third quarter. Then Shapiro rained down shots from beyond the college 3-point line to help boost the Bulldogs’ lead back to 11 points by the end of the third quarter.

“I felt like the game was in our hands when they started coming back in the third quarter,” Brovelli said. “Our energy was low, but during the timeout I told everybody to keep their heads up and get this win.”

San Marin still had enough in the tank for another push in the fourth quarter. The Mustangs trailed 60-50 when they went on a 9-0 run. After a pair of free throws from Morgan, Rhodes got a midcourt steal and fed the ball to Means for the layup. Rhodes then followed with a 3-pointer and Means hit a mini-sky hook in midair to cut the gap to just one point with 3 minutes to play.

Will Healy hit a layup to give the Bulldogs some breathing room, but Means retaliated with a game-tying 3-pointer with 2 minutes to play.

Shapiro found Wyatt Tornello cutting to the hoop for a quick layup that gave the Bulldogs the final margin they needed. Tornello finished with nine points and four rebounds.

The Bulldogs close out the regular season Thursday against rival Terra Linda (16-7, 4-2), as both teams shine their dancing shoes for the MCAL tournament.

“I care more about my players than I do myself, and I spend more time in my Bible than I do in my playbook,” Hamilton said. “It’s about the kids and just me believing in myself and what they do. This does not happen without faith, and that doesn’t happen unless you put your players first.”

Meanwhile, the Mustangs are ready to take out their frustrations against Novato (6-17, 0-7) and non-league foe Petaluma as San Marin waits for the North Coast Section pairings.