Australia weathered an early storm from South Africa to record a 25-17 victory in Sydney as George Gregan and Stephen Larkham made their final international appearances on home soil.
The Springboks got off to a dream start with two tries in the opening seven minutes at the Telstra Stadium in Sydney and added a subsequent penalty to race into 17-0 lead early in the first half.
But the Wallabies regained their composure to close to within 17-10 at thebreak before adding a further two tries in the second half to secure an unconvincing Tri-nations victory.
South Africa opened the scoring in the sixth minute when flanker Wikus vanHeerden crashed over from short range on the back of some excellent lead up work from his pack.
A minute later an errant Nathan Sharpe pass landed in the hands of dynamic veteran Breyton Paulse, who ran 50 metres to silence the home crowd.
Derick Hougaard's 16th-minute penalty - awarded after Sharpe was caught in an offside position - extended the lead to 17-0.
The Wallabies capitalised on their first possession of the match in the Springboks half with an enterprising backline move that saw Mark Gerrard cross for their opening five-pointer in the 21st minute with Mortlock's conversion making it 17-7.
It was all the Wallabies for the remainder of the half and they narrowed the gap to just seven with a Mortlock penalty in the 37th minute.
They continued their momentum when man-of-the-match Stephen Hoiles crossed for a converted try to level the scores at 17-17 just three minutes after the break.
The Wallabies remained in the ascendancy with a penalty goal in the 51st minute making it 20-17 and assumed greater control when Gary Botha was sin-binned in the 53rd minute after repeated South African infringements.
The home side capitalised on the extra man in the 55th minute when Matt Giteau gathered a delicate kick from Gerrard to make it 25-17 and seal the win.
Australia (10) 25
Try: Gerrard, Hoiles, Giteau
Con: Mortlock (2)
Pen: Mortlock (2)
South Africa (17) 17
Tries: Van Heerden, Paulse
Con: Hougaard (2)
Pen: Hougaard
Yellow Cards: Botha (SA), Muller (SA)
Man of the Match: Stephen Hoiles (AUS)
Attendance: 51,174
Australia: Huxley; Gerrard, Mortlock (capt), Giteau, Ashley-Cooper; Larkham, Gregan; Dunning, Freier, Shepherdson, Sharpe, Vickerman, Elsom, Smith, Hoiles.
Replacements: Hardman, Baxter, McMeniman, Lyons, Waugh, Staniforth, Mitchell.
South Africa: Fortuin; Paulse, Murray, Olivier, Pietersen; Hougaard, Pienaar; Van der Linde, G Botha, J du Plessis, Ackermann, J Muller, Van Heerden, Wannenburg, Skinstad (capt).
Replacements: B du Plessis, Andrews, Van den Berg, J Cronje, Claassens, Grant, Pretorius.