South Africa completed a 3-1 series win, the first time they had beaten Australia in a home series since 1969/70.
It brought to an end a series of high-quality cricket and even greater off-field drama, culminating in a ball tampering scandal during the third Test in Cape Town which resulted in former captain Steve Smith, vice-captain David Warner and Cameron Bancroft sent home.
Four balls later Mitchell Marsh was caught behind without a run having been added to the overnight 88 for three. It was Philander's 200th wicket in his 54th Test.
Peter Handscomb was next, bowled off an inside edge for 24 as he tried to withdraw his bat - an almost exact replica of his first-ball dismissal in the first innings.
Chadd Sayers was caught at third slip off the first ball he faced. At that stage Philander's figures for the morning were 5.2-2-3-6.
Morne Morkel, playing in his final Test, had been given a guard of honour by his teammates and support staff when he walked on to the field at the start of the day.
With nine wickets down, Morkel was given the ball but was unable to add to his 309 Test wickets. The final wicket fell to a run-out, with Nathan Lyon failing to beat Aiden Markram's throw from point as he went for a second run off Morkel's bowling.