One year after winning the Class 1A state title, New Town claimed the 2A crown against Middletown.

The New Town boys basketball team had 18 seconds left in its season Saturday with the difference between winning and losing the Class 2A state championship coming down to playing defense against equally determined Middletown.

The No. 1 Titans, whose defense has been its base throughout, were more than comfortable with that.

Protecting a two-point lead, they did what they've done in all the season's important moments: clamped down. Middletown guard Clay Smith drove the baseline and when the Titans had it covered, he threw a desperate pass to the middle that New Town senior guard Matthew Johnson was waiting for.

Matthews was fouled with four seconds left, hit his two free throws and, soon after, the Titans were celebrating a 56-52 win over the Knights at Maryland's Xfinity Center.

New Town captured its second straight crown — last year's coming in the Class 1A ranks — and the program's third, closing out the season by winning its last 17 games to finish with a 23-2 mark. Senior Devin Smith carried the Titans on offense in the first half and finished with 17 points. Johnson, who spent much of the first half in foul trouble, picked up the slack with all 12 of his points coming in the second half.

Browse pictured from No. 1 New Town's victory over Middletown in the Class 2A state championship game on March 12, 2016.

With neither team holding more than a two-point lead throughout the fourth quarter, the Titans were confident they would find a way.

"We've been in these situations before and we're used to them. So when they occur, we already know what to do. That's how we play," Johnson said.

When Middletown senior Matt Considine scored with 3:41 to play, the Knights (21-6) had a 52-51 lead.

The Titans kept them from scoring the rest of the game.

With the Knights defense proving stingy as well, it was a fight for the Titans to reclaim the lead, but they did when Chris Fitzgerald hit two free throws for a 53-52 lead with 1:34 to play. The Titans got another tough stop and then made it 54-52 when Johnson hit one free throw with 53 seconds left. Two more stops were needed before Johnson sealed the victory.

"We just never say die," New Town coach Mike Daniel said. "We talk about it, our practices, our wars and these guys never ever gave up. I'm so proud of these guys — it's been like this the entire year."

The Titans were hot and cold in a first half that saw Middletown claim a 30-26 lead at the break.

They fell behind by seven points in the first quarter before making the most of the last minute with Smith hitting a 3-pointer and Rashad Faust following with a driving layup to cut the Knights' lead to 11-9.

Smith got going in the second quarter — scoring 10 points and adding two assists as the Titans took a 20-15 lead midway through before it was Middletown's turn to respond.

The Knights, who were playing in their first state title game since 1979 in search of the program's first crown, closed out the half on a 15-6 run with Clay Smith scoring seven of his 14 first-half points during that time.

Johnson got going midway through the third quarter with three straight baskets, and later Faust hit a 3-pointer with 32 seconds left to give the Titans a 46-43 lead going into the fourth quarter.