The Western Stormers ensured they finished top of the Super XV table after a thrilling win over the Melbourne Rebels at Newlands.
With the South African Super Rugby Conference secured, Allister Coetzee's side needed to beat their Australian opponents - who had nothing but pride to play for- to make sure they finished above the Waikato Chiefs.
A first-half try from Juan de Jongh and three penalties and a conversion from Peter Grant gave their side a commanding 16-0 advantage at the break.
Rodney Blake and then Nick Phipps scored converted tries for the visitors to reduce the deficit to two.
De Jongh and James Hilgendorf exchanged converted tries to ensure a thrilling finale before Grant's penalty with four minutes left secured the win.
The Stormers began the game on the front foot as the Rebels started sluggishly, giving away two sloppy penalties which were punished by Grant.
Stormers were totally dominant and scored their first try of the game after 14 minutes as de Jongh eased through the Rebels defence beating two men to touch down under the posts, with Grant adding the extras.
After a spell of pressure from the Rebels, the Stormers ended the half as they began it as Grant converted a penalty in front of the posts.
The Rebels got on the board in the 50th minute as Blake crashed over the line, with Julian Huxley adding the conversion.
And just three minutes later the Newlands crowd started to panic as Phipps skipped through a sluggish defence to touch down, as Huxley again added the extras.
That seemed to wake up the hosts who replied immediately as de Jongh ran onto a pass from Grant to score under the posts, as Grant maintained his 100% success rate with the boot to open the gap to nine.
But the Rebels were not beaten and with 10 minutes left, Nic Stirzaker broke through the Stormers defence before offloading to Cooper Vuna who scored under the posts.
Huxley converted again but his counterpart Grant converted another penalty, meaning the Rebels needed a converted try to complete a remarkable win.
They could not penetrate the defence again as the Stormers held on to
secure a home tie in the semi-finals of the tournament.