The Orioles had won six of seven and needed a win to qualify for the Division 2 tournament. The Raiders had lost five straight and needed a win to help keep their playoff hopes alive.

A late three-point play by James Ryan gave Belchertown the lead and the Orioles held on for a 58-54 win that ensures they will play in the postseason.

“This is the hardest place to play,” Ryan said. “In the four years I’ve played this is without a doubt the hardest place to play. It’s a different atmosphere out here. We got stronger as a team with this win.”

Belchertown (10-8, 3-4 Bi-County North) has won six straight and in the process put Hampshire in a difficult spot on the tournament bubble. The Raiders (7-10, 2-4) need to win their remaining three games, beginning Friday at Southwick, to qualify.

“We played with some intensity and some fire today,” Hampshire senior Shane Andrews said. “We’re in a position right now where we can’t lose any games. We’re playing with a little inspiration right now.”

There were 12 ties, including five in the fourth quarter, and 19 lead changes in the game.

“Last time we came out soft and they got a big lead on us and we were flustered for the rest of the game,” said Andrews of the Raiders’ 52-30 loss at Belchertown on Jan. 30. “Tonight we came out, we were patient, we were calm and we played a tough game. I’m really proud of my guys tonight.”

With less than two minutes remaining, Zach Parsons of faked left and turned right on the block and scored for the Orioles despite being triple-teamed. His basket gave Belchertown a 53-51 lead with 1:40 left.

On Hampshire’s next possession, Andrews drilled a 3-pointer along the right wing for a 54-53 lead with 1:10 remaining, but the Orioles answered quickly. Ryan found room underneath and converted a three-point play with 48.8 seconds left.

After exchanging turnovers, the Raiders called timeout with 16.9 seconds left. Adam Laroche took possession at the top of the key but his deep 3 attempt with 5.5 seconds left was short. Tyler Verville then sealed the win with two free throws.

“We were definitely going for the win there at the end. I wanted it a little closer to the basket,” Hampshire coach Claud Salomao said. “I knew everyone was going to key in on Shane and Adam had a great night tonight. I put the ball in a senior’s hands when it comes to a game like that.”

Parsons finished with 16 points, while Verville added 15 and Ryan 10 for Belchertown, which has found its way since a four-game losing streak in January.

“With a new coach (Bill Beauregard) and all it was hard to get situated,” Ryan said. “Once we found our rhythm we pretty much took off. ... We turned our focus to defense. Before we were relying on big shots to bail us out, but now we realize it all starts on the defensive end.”

Andrews finished with 17 points, while Conor Cronin and Laroche each had 14. Andrews and Laroche are co-captains and the only seniors on the team.

“Seniors have everything to lose,” Salomao said. “The last guy to quit is the one who has the most invested. The seniors are really trying to leave it all on the court because they want to go out with a playoff berth. Essentially our playoffs start Friday at Southwick.”