MIDDLEBURY, Vt. -- Putting a frustrating night of shooting behind him in the most dramatic of fashions, Aaron Toomey buried a three-pointer with five seconds remaining in the third overtime, lifting second-ranked Amherst to a 104-101 win against No. 3 Middlebury in an epic regular season finale at Pepin Gym on Tuesday.

With the win, Amherst completed its second consecutive 10-0 NESCAC season, improving to 22-2 overall and clinching the top seed in the upcoming conference playoffs. The Lord Jeffs have now won 16 games in a row and 23 consecutive NESCAC contests dating back to the 2010-11 season.

Willy Workman was perhaps the biggest hero for Amherst, scoring a career-high 30 points and matching his personal best with 13 rebounds, none bigger than a stunning put-back of his own intentionally missed free throw which brought the Jeffs back from the brink of defeat and tied the game in the final second of the second overtime.

In a back-and-forth marathon between top-five programs, Amherst seemed in control, taking a 14-point lead early in the second half before Middlebury (21-2, 8-2 NESCAC) roared back, grabbing a lead of its own late in regulation. But Peter Kaasila scored two of his career-high 29 points with 20 seconds to go and Joey Kizel could make only one of two free throws in the final moments as the contest headed to an extra period tied at 69.

With James Jensen blocking Toomey’s last-second attempt as a seesaw first overtime ended knotted at 81, the Panthers seemed poised to win it in the second extra frame, taking the lead on a clutch Nolan Thompson triple with 26 seconds left then going up 91-88 on a Jake Wolfin free throw with just five seconds remaining. But Wolfin missed his second attempt and Middlebury opted to foul Workman before he could attempt a potentially game-tying three-pointer, sending the Jeff senior to the line with two seconds to go. After sinking the first shot, Workman immediately threw a line drive at the front rim, catching everyone off guard and racing in for the put-back to send the game onward.

The drama continued in the final extra frame as Kizel’s three cut a four-point Amherst lead to one at 101-100 with 1:11 to play and Thompson stole a Jeff inbound pass with 29 seconds left, giving the Panthers a shot at the win. Jensen drew a foul with 11 seconds still on the clock but could only make one of two, positioning Toomey to finally break through. Shooting just 4-of-23 from the field and 1-of-10 from long range to that point, the Jeff junior dribbled up the right side, freed himself with a nifty crossover and buried the redemptive winner.

Toomey finished with 16 points and eight assists for Amherst, while Kaasila added 11 boards to his career night of scoring and Allen Williamson ’13 also reached double figures with 17 points and eight rebounds. Kizel matched Workman’s game high with 30 points for Middlebury while Wolfin and Thompson each added 17.

With even play in the opening minutes, Middlebury posted the game’s first significant run as a Chris Churchill layup put the Panthers ahead 25-18 with 9:33 to play in the first half. The Jeffs responded in a big way, however, outscoring Middlebury 25-4 over the remainder of the half as Workman struck for 17 points on 6-of-7 shooting in the opening frame.

Middlebury came out strong in the second, however, with Thompson scoring 10 of the Panthers’ first 12 points, his three-pointer from the right side capping a 7-0 spurt and cutting Amherst’s lead to six at 47-41 with 14:15 still remaining. After the Jeffs temporarily stemmed the tide, Middlebury had another run in them as a Peter Lynch bucket and a three-point play from Kizel made it 58-51 with 8:40 to go.

Williamson had the answer, driving baseline for a highlight-reel dunk, but the Panthers would not go away, posting a 12-2 run to set up the dramatic finish to regulation. After Kizel drained a three to make it 65-61 with 5:07 to go then grabbed a steal and assisted a Jack Roberts layup to make it a two-point game with 4:16 remaining, Wolfin broke a two-plus minute scoring drought from both teams with a clutch three that put the hosts up 66-65 with 1:30 to play.

Playing with four fouls, Kaasila responded with a pair of free throws to put the Jeffs back in front. After Thompson hit a pair of free throws for the Panthers, Kaasila stepped up again, grabbing the rebound off a missed Toomey layup and putting it back for a 69-68 Amherst lead with just 20 seconds left. Driving for the win in the final seconds, Kizel drew a foul from Williamson, but the Panther point guard could only make the first of two, tying it at 69 and sending the teams on to the trio of dramatic extra sessions.

The Jeffs shot at a 49.4 percent clip over the duration of a largely clean contest which saw just 25 combined turnovers over 55 minutes of action. Amherst held Middlebury to a 42.7 percent field goal percentage and out-rebounded the hosts, 51-44, but a 56 percent Panther shooting performance in the second half of regulation allowed Middlebury to claw back into the contest.

The stunning Jeff triumph avoided a three-way tie atop the conference standings as Williams handled Trinity (Conn.) to claim the second seed. Top-seeded Amherst will host No. 8 Colby in the quarterfinals on Saturday, Feb. 16.