The 2010 Open Champion had won four of his eight European Tour titles on home soil but had yet to win his home Open and was playing the event for the first time since finishing third in the 2011 season.
He entered the final day at Randpark Golf Club with a three-shot lead and while he saw that cut to one after three holes, he recovered to sign for a 67 and get to 18 under, six shots clear of Frenchman Romain Langasque.
Langasque's closing 66 earned him one of three spots available for The Open Championship at Royal Portrush Golf Club next summer, with 2011 Masters Tournament winner Charl Schwartzel and England's Oliver Wilson claiming the other two.
Schwartzel and Wilson finished at ten under alongside South Africans Thomas Aiken and Bryce Easton.
Oosthuizen joined Bobby Locke, Gary Player, Bob Charles, Ernie Els and Henrik Stenson as the only players to win The Open and South African Open as he claimed a first victory since the 2016 ISPS HANDA Perth International.
“I wish the family was here,” said Oosthuizen as he struggled to fight back the tears on the 18th green. “The crowd was great this whole week, it was nice to do it for them.
“I knew today was either going to be very special or heartbreaking. I know there's only a few that have won The Open and the SA Open so I'm very chuffed to have my name on this.
“We had a tough start today and my caddie just told me, 'you're swinging it well, just go for it'. I just got back to basics, to try and hit fairways and greens. I know I'm putting well, I just needed to give myself putting opportunities for birdie.
“This feels very special. This is perfect.”
Oosthuizen recovered from a poor tee-shot on the first to make a par but could not repeat the feat on the second and when he went right again off the third tee and found sand with his second, the lead was down to one.
A birdie on the par-five next and an approach to six feet on the sixth then moved him back into a three-shot lead and nobody would get any closer.
A long double-breaker on the seventh brought another gain and Oosthuizen drove the ninth green and got down in two to lead by five at the turn.
Langasque had bogeyed the third but birdies on the fourth, sixth, ninth, 12th and 13th sent him up the leaderboard, with a brilliant second to four feet on the par-five 14th setting up an eagle.
That cut the lead back to three shots but tee-trouble on the 16th for the Qualifying School graduate sent him back to 12 under and Oosthuizen had a comfortable lead once more.
The leader put his second on the par-five 14th to two feet for an eagle and a six-shot lead and he led by seven after a stunning approach on the 16th.
A bogey on the 17th after finding sand off the tee meant he would only share the record winning margin since this event joined the European Tour in 1997, but that could not take the gloss off the emotional scenes on the final green.
Schwartzel had led after 36 holes and a 72-72 weekend was enough to give him a seventh top five at this event and an 11th consecutive appearance at The Open.
A closing 67 means Wilson will be appearing at The Open for the sixth time by virtue of World Ranking, while Easton and Aiken closed with rounds of 66 and 67 respectively.
A closing 73 from Madalitso Muthiya earned him the best-ever finish by a Zambian on the European Tour, with South Africans Branden Grace, Jbe Kruger, Anthony Michael, Brandon Stone and Haydn Porteous, South Korean Yikeun Chang and Dane Jeff Winther also at nine under.