Loose forward Sam Smith has scored a try in the dying moments - converted by Lincoln McClutchie - to prise the Ranfurly Shield from the grasp of previously unbeaten NPC champions Wellington.
The Lions were seeking to run the table of regular season games, after nine previous victories this season, but fell 20-18 at the final hurdle, handing the 'Log O' Wood' back to the team they won it off 12 months ago.
Wellington had one last chance to salvage victory in the final seconds, but knocked the ball on, as they mounted their final assault, sparking celebrations among their Magpies counterparts.
The holders seemed to have the trophy locked away for another season, when they led 18-13 with fulltime looming, but the Bay forwards laid siege on the goal-line, with Smith eventually driven over under the crossbar and McClutchie slotting the winning points from in front.
"Immensely proud of the boys," reflected Bay captain Tom Parsons. "Wellington have been the top side all year and we prepped for that - we knew it would take everything and I think it did.
"Both sides went hammer and tong. The Ranfurly Shield is something special in New Zealand rugby and it brings games like that out, where you have to play for 80 minutes."
Wellington remain six points clear atop the NPC table and take top seeding into next week's quarter-finals, where they will face Waikato. Hawke's Bay climb to third on the table, but await the outcome of Taranaki v North Harbour to learn their knockout opponents.
Waikato have clinched their quarter-final spot with a 37-35 win over Canterbury, ending the hopes of Counties Manukau and Harbour. Winger Gideon Wrampling had a try double for the Mooloos, while Tepaea Cook-Savage added 12 points.
Hawke's Bay 20 (Sapsford, Lowe & Smith tries; McClutchie 2 conversions) Wellington 18 (Kirifi & Poasa tries; Morgan 2 converions & penalty)
Waikato 37 (Wrampling 2, Wrampling-Alec, Cook-Savage, Roe & Tucker tries; Cooke-Savage 2 conversions & penalty) Canterbury 35 (Gardiner, McLeod, Jager, Drummond & Funnell tries; Burke 5 conversions)