The Melbourne Rebels had to come from behind to beat the Highlanders 38-37 and secure their fifth Super Rugby victory of the season.
The victory makes this season the Rebels best ever season as they won three matches in 2011 and four in 2012.
With a minute remaining the Rebels were trailing by four points but Bryce Hegarty scored his second try to put the home side into the lead for the first time in the match.
The Rebels stormed back from 24 points down at halftime to nudge out the Highlanders in an astonishing second half performance.
The Rebels, with several leading players playing their final match for the club, scored five second-half tries to reel in the Kiwis, who had a bonus point wrapped up with their fourth try by halftime.
But just as the Highlanders were the dominant team in the opening half, the roles were reversed in the second term with the Rebels powering home for victory, clinched in the final minute through fly-half Bryce Hegarty's second try.
The Rebels are in a state of transition with Wallaby back James O'Connor and coach Damien Hill on their way out and Welsh forward Gareth Delve and winger Cooper Vuna also leaving the club.
O'Connor, who learnt this week that his contract would not be renewed by the Rebels a day after playing for the Wallabies in the losing final Test against the British and Irish Lions, came off the replacements' bench early in the second half to play a pivotal role in the Rebels revival.
O'Connor had a hand in three tries and was the go-to man as the Rebels launched wave after wave of attacks at the tiring Highlanders defence.
Centre Tom English, Vuna and Hegarty all scored two tries with Jason Woodward landing four conversions, while Ben Smith, Hosea Gear, Tamati Ellison and Tony Woodcock scored the Highlanders' tries in the first half.
Fly-half Colin Slade was in immaculate goalkicking touch with four conversions and two penalties before he was replaced by Hayden Parker, who kicked a late penalty to put the Highlanders ahead 33-37 with two minutes left.
It capped a dismal season for the Highlanders, who finished at the bottom of the New Zealand conference with just three wins from their 16 games.
Delve, who leaves after playing in the Rebels' first three seasons, was thrilled with his team's stunning comeback.
"I don't think you could have written a better script for our final game of the season," Delve said.
"The first half was pretty ugly but we showed the character in the second half and that's why there's such a bright future for the guys coming up."
"We kept our calm. We were really unhappy with that first half, but we knew that keeping hold of the ball and playing through our phases then we would get ourselves back into the game and that's what happened."
Skipper Andrew Hore said the defeat was symptomatic of the Highlanders' frustrating season.
"We are obviously annoyed. At the start of the year there was a lot of hype down in the deep south (of New Zealand) that the Highlanders were going to go pretty well, but we bumbled along and tonight probably summed up our season," Hore said.
"We played well in patches, but not for 80 minutes. But we'll rebuild for the new season."
Both teams were out of playoff contention in their final matches of the season and the Rebels finish the season in 12th place while the Highlanders finish in 13th place.
Last year the Highlanders finished in ninth place while the Rebels finished in 13th place.
Final Score Rebels 38 (7) Highlanders 37 (31)
Tries - T.English 2, C.Vuna 2, B.Hegarty 2
Con - J.Woodward 3
Tries - B.Smith, H.Gear, T.Ellison, T.Woodcock
Pen - C.Slade 2, H.Parker
Con - C.Slade 4
Referee: Andrew Lees
Assistant Ref 1:Angus Gardner
Assistant Ref 2:Matt O'Brien
TMO : Peter Marshall
1. Nic Henderson 2. Ged Robinson 3. Laurie Weeks 4. Hugh Pyle 5. Cadeyrn Neville 6. Jarrod Saffy 7. Scott Fuglistaller 8. Gareth Delve (c) 9. Nick Phipps 10. Bryce Hegarty 11. Cooper Vuna 12. Rory Sidey 13. Tom English 14. Jason Woodward 15. Angus Roberts
Replacements :16. Shota Horie 17. Paul Alo-Emile 18. Luke Jones 19. Jordy Reid 20. Nic Stirzaker 21. James O'Connor 22. Kimami Sitauti.
1. Tony Woodcock,2. Andrew Hore (c) ,3. Ma'afu Fia ,4. Brad Thorn ,5. Josh Bekhuis ,6. TJ Ioane ,7. Elliot Dixon ,8. Mose Tuiali'i ,9. Aaron Smith ,10. Colin Slade ,11. Hosea Gear (vc),12. Tamati Ellison ,13. Jason Emery ,14. Kade Poki ,15. Ben Smith
Replacements : 16. Liam Coltman ,17. Bronson Murray,18. Jake Paringatai,19. Joe Wheeler ,20. Fumiaki Tanaka ,21. Hayden Parker ,22. Shaun Treeby