Ulster secured a home quarter-final in the United Rugby Championship thanks to a bruising and breathless 24-21 win over the Sharks at the Kingspan Stadium.
Dan McFarland’s men were already guaranteed a place in the knockout stages of the competition but required a win to seal a last-eight tie in Belfast.
And they delivered in pulsating fashion thanks to a first-half try from Michael Lowry and second-half scores from impressive centre pairing Stuart McCloskey and James Hume.
Read more: Premier Sports win Northern Ireland broadcast rights for Nations League and Euro qualifiers
Two late tries from Marius Louw and the electrifying Grant Williams teed up a grandstand finish but Ulster held on for a vital win in the final game of the regular league season.
The only dark note for McFarland was a first-half injury to Lowry who left the pitch with a badly swollen cheek after a crunching tackle on Aphelele Fassi.
On clinching a home quarter-final, head coach McFarland told Premier Sports: “Stadiums don’t win you matches but the bottom line is you’d prefer to be at home to play a play-off game and we will be now.
"It’s just as much for the fans as it is for anything else. It could be against another South African side and it will be another brutal, physical test, but we’ll relish that challenge."
Ulster were 10 points to the good at the break thanks to a penalty from John Cooney and a well-worked try from Lowry.
Cooney, who ended the game with nine points, dissected the posts in the 17th minute to ease the home side into a 3-0 lead.
And it was 10-0 in the 27th minute when the livewire Lowry scrambled over for his fifth try of the season.
Billy Burns fizzed a long pass to Ethan McIlroy and the winger produced a superb pass inside for Lowry to crash over from close range.
Ulster started the second period on the front foot and were 17-0 up in the 44th minute.
Captain Iain Henderson offloaded to the supporting McCloskey who fended off both Marius Louw and Fassi to touch down under the posts, Cooney converting.
The Sharks hit back in the 63rd minute when Ntuthuko Mchunu, helped by the bulk of Bongi Mbonambi, crashed over from a tap and go.
Curwin Bosch converted to cut the deficit to 10 points, only for Ulster to restore their advantage with their third try of the evening.
Billy Burns zipped a pass to Robert Baloucoune who broke down the right wing and passed inside for the supporting Cooney who in turn fed Hume to race home. It was a sensational score.
Hume blew a kiss to the crowd in celebration before Cooney stepped up to add a further two points to edge the scoreline up to 24-7.
Over? No. There was still plenty of drama to come.
Sizzling substitute Williams sliced through the Ulster defence to send Louw clear for a 76th minute try for the Sharks, which Boeta Chamberlain converted.
And two minutes later Williams teed up a nervy finish as he raced clear of a flagging Ulster defence from inside his own half.
Chamberlain stepped up to kick the conversion to bring the Sharks to within three points with 20 seconds of normal time remaining.
But Ulster held on for a crucial win that clinched a home tie in the quarter-finals which will be played on the weekend of June 4.
Read more: Michael Dunlop opens up on his 'love of road racing' despite family tragedies
Read more: Michael Conlan opens up on brutal weight cut and two-stone gain since Leigh Wood defeat
Sign up to our free sports newsletter to get the latest headlines to your inbox.