Mateen Bhaghani kicked a 23-yard field goal with two seconds remaining to lift the Bruins to a 20-17 victory over the Terrapins.