ORONO — Matt Nieto capped a thrilling Hockey East game at Alfond Arena with a breakaway goal 3.8 seconds before overtime expired to give Boston University a 5-4 victory over Maine Saturday night before a crowd of 4,594.

The Black Bears scored the final three goals of regulation to force overtime after falling behind 4-1 a minute into the third. The tying goal came with 40 seconds left and goalie Martin Ouellette on the bench for an extra attacker.

Steven Swavely won a faceoff in the offensive end, then headed for the slot as the puck cycled around to Jake Rutt near the left point. Rutt fired and Swavely tipped the puck into the net to send the home crowd into a frenzy.

Maine had several good chances in overtime, but the last one left the Black Bears out of position and BU capitalized. Evan Rodrigues raced up the ice with Nieto and fed him before Ouellette could react.

The loss leaves Maine at 8-16-6 overall, 4-11-6 in Hockey East. Boston University is 14-12-2, 11-7-2.

Ryan Lomberg gave Maine a 1-0 lead with a power-play goal in the first period before Boston University scored three in the second and then took a 4-1 lead early in the third.

Maine responded with goals by Joey Diamond and Devin Shore to make it 4-3 midway through the third.