The Sharks booked a place in the 2014 Super Rugby Semi-finals against the Crusaders when they beat the Highlanders 31-27 at Kings Park in Durban.
The Sharks had to chase the game for much of the match and the Highlanders led 13-17 at half time.
Both teams scored three tries each and the difference came down to kicks with Frans Steyn kicking four penalties and two conversions while Lima Sopoaga kicked two penalties and three conversions.
"I'm just proud of our character ... I thought we did ourselves justice tonight," said Highlanders fullback Ben Smith after the match.
Two tries in three minutes by Bismarck du Plessis and Tonderai Chavhanga helped the Sharks book their Super Rugby semi-final ticket.
The pair crossed in the 53rd and 56th minutes after their side had been stunned by a fine comeback from the visitors, which saw them lead 17-14 by half time at Kings Park.
Marcell Coetzee also scored for the Sharks, while Frans Steyn kicked 16 points in another strong display at flyhalf with Jake White's men holding on to book a last four meeting against the Crusaders in Christchurch next week.
They started the game well enough with a penalty inside the opening 120 seconds when lock Jarrad Hoeata was caught off-side at a ruck, allowing Steyn to kick the first points.
The hosts had the first try after 14 minutes when they won an attacking line-out and drove forward powerfully allowing Coetzee to carry over from the driving maul.
Shortly after Jannie du Plessis had a try disallowed for a double movement as the Sharks took total control of the setpiece.
But the visitors hung in there and finally had their first points after 26 minutes when Lima Sopoaga landed a long-range penalty after Du Plessis was called for off-side by referee Steve Walsh.
Steyn popped over another penalty when flanker Shane Christie was caught for some illegal play at the ruck, but then Malakai Fekitoa scored the game's outstanding try when he pierced through a hole on the halfway line as he latched onto Ben Smith's pass and escaped three tackles to score on the right hand side of the field.
Steyn struck the post with a penalty attempt three minutes from the break, before another seething Highlanders attack ended when All Blacks centre Fekitoa failed to release.
However, the home crowd was stunned into silence moments after the half-time siren when Kane Hames scored on the left following an attack that started in his side's own 22 metre area with Nasi Manu and Hoeata setting the big prop on his way.
That score put the Highlanders into a four point lead at the break, a lead that was extended to seven when Sopoaga landed another penalty after Willem Alberts entered a ruck from the side.
Moments before that Steyn had the opportunity to cut the gap to one, but the Sharks chose an attacking line-out that came to nothing.
The game turned on its head during a three-minute spell thereafter when skipper Bismarck and Chavhanga both crossed, the former after the Highlanders' set-piece was again torn to shreds and the latter sprinting over on the left for his first score of the season.
The plucky Dunedin side refused to give in though, and they retook the lead through another blistering attacking move as Patrick Osbourne brilliantly offloaded to Phil Burleigh to score.
Sopoaga put the Highlanders in front again, before the Sharks emphatically turned over a scrum on the visitors' goal-line moments after Jean Deysel knocked on, allowing Steyn to make it 28-27.
With the returning Patrick Lambie on the field after nearly four months out injured, the Sharks won another penalty right in front of the posts, allowing Steyn to kick over and seal a very tight victory for the home side.
"I must say they ran us to pieces at some stages," said Sharks captain Bismarck du Plessis.
"Their whole backline was absolutely amazing."
The Sharks now travel to Christchurch to face the Crusaders who they beat earlier this season 25-30 in Christchurch with 14 players for most of the match.
"I'll say we do take confidence (into the semifinal)" added Du Plessis.
"We really hope the whole of South Africa is behind us."
Final Score Sharks 31 (13) Highlanders 27 (17)
Tries - M.Coetzee, B.du Plessis, T.Chavhanga
Pen - F.Steyn 4
Con - F.Steyn 2
Tries - M. Fekitoa, K.Hames, P.Burleigh
Pen - L.Sopoaga 2
Con -L.Sopoaga 3
Referee: Steve Walsh
AR1: Jaco Peyper
AR2: Cobus Wessels
TMO: Shaun Veldsman
15. SP Marais , 14. S'bura Sithole , 13. JP Pietersen , 12. Paul Jordaan , 11. Lwazi Mvovo , 10. Frans Steyn , 9. Cobus Reinach , 8. Ryan Kankowski , 7. Willem Alberts , 6. Marcell Coetzee , 5. Stephan Lewies , 4. Anton Bresler , 3. Jannie du Plessis , 2. Bismarck du Plessis (c) , 1. Thomas du Toit
Replacements , 16. Kyle Cooper , 17. Dale Chadwick , 18. Lourens Adriaanse , 19. Etienne Oosthuizen , 20. Jean Deysel , 21. Charl McLeod , 22. Pat Lambie , 23. Tonderai Chavhanga
1 . Kane Hames , 2 . Ged Robinson , 3 . Chris King , 4 . Jarrad Hoeata , 5 . Joe Wheeler , 6 . Elliot Dixon , 7 . Shane Christie , 8 . Nasi Manu (Co.Captain) , 9 . Aaron Smith , 10 . Lima Sopoaga , 11 . Patrick Osborne , 12 . Phil Burleigh , 13 . Malakai Fekitoa , 14 . Richard Buckman 15 . Ben Smith (Co.Captain)
Replacements : 16 . Liam Coltman , 17 . Matias Diaz , 18 . JP Koen , 19 . Josh Bekhuis , 20 . Tom Franklin , 21 . Fumiaki Tanaka , 22 . Trent Renata , 23 . Gareth Evans