HARVARD — Monday afternoon’s Middle School basketball battle between the Ayer-Shirley and Bromfield boys turned out to be three games within one, but in the end a pair of free throws by Tyler Mayo in the final seconds was the difference in Ayer-Shirley’s 26-24 win.

Bromfield started out strongly, shutting down the visitors’ offense for more than four minutes. Kevin McCauley (12 points, 15 rebounds) scored after grabbing an offensive rebound, Charles Mednieks buried a 17-footer, Will Malloy scored on a drive, and McCauley hit a short jumper for an 8-0 lead.

Ayer-Shirley totally turned things around and controlled play over the remainder of the first half. The visitors finished off the first period with its own 8-0 run to tie the game at 8-8. Owen Carpenter hit a pair of free throws, John Gendron finished off a drive, and Jonathan Durben hit a 15-footer, before Mayo tied the game with a drive.

The teams traded baskets to open the second quarter, Daniel Goldstein putting Ayer-Shirley on top for the first time when he converted a steal into a lay-up. Bromfield’s Kyle Asquith drew his team even with a 15-footer, but once again Ayer-Shirley finished the quarter with the final eight points to build an 18-10 halftime advantage. John Gendron (six points, four rebounds, three steals) was the spark plug for the visitors with a pair of baskets and inspired play.

Bromfied’s Malloy did a nice job of harassing Ayer-Shirley players with persistent defense, coming up with three steals.

The third quarter started the same way the first quarter did, with the Bromfield defense shutting down the Ayer-Shirley offense, allowing just three points in the quarter. Matt Olejarz converted a steal into a lay-up, Tate Edmonds came up with another steal and turned it into points, before a 10-footer by McCauley drew the Trojans to within 18-16.

The Ayer-Shirley offense finally got untracked and Chris Patano scored the final three points of the quarter on a free throw and a lay-up to extend the visitors’ lead to 21-16 entering the fourth quarter.

Bromfield came out and immediately cut into the lead when Connor Sloan scored on a strong drive and McCauley converted after hauling down an offensive rebound to make it 21-20.

Ayer-Shirley’s Alex Walker (five points, two rebounds, three steals) rebuilt the lead to three with a lay-up, but Bromfield bounced back to take the lead when McCauley scored on a drive and added a follow-up basket.

Points were scarce in the final minutes as both teams dug in defensively. Walker tied the game at 24-24 when he connected on a free throw, and, with the clock winding down, Mayo drove to the basket and was fouled. He calmly stepped to the stripe and hit both shots to clinch the win.