Graeme Smith finishes as he started – out for three against Australia

South Africa's captain lasts three balls in final innings
Australia give Smith guard of honour to the middle
Graeme Smith's international career – in pictures
South Africa's Graeme Smith
South Africa's Graeme Smith leaves the pitch after his final international innings as Australia applaud during the third Test at Cape Town. Photograph: Stringer/Reuters

Graeme Smith's long and distinguished Test career ended in deflating anticlimax as his last innings lasted only three balls before he fell for the fourth time in six innings against Australia to Mitchell Johnson – whose pace and hostility has done so much damage to both South Africa and England over the past four months.

But two of Smith's senior lieutenants, Hashim Amla and AB de Villiers, then frustrated Johnson and the rest of the Australia attack for more than two hours to preserve an outside chance that the captain will not bow out with a series defeat.

There seemed a real danger of the world's No1-ranked Test team failing to take the match into the final day when they slumped to 15 for three at tea on the fourth day, Michael Clarke having declared Australia's second innings on 303 for five after David Warner cracked his second century of the match, and his third of the three-Test series.

But Amla and De Villiers showed their courage and class in a fourth-wicket partnership of 53 in more than 30 overs until Amla fell lbw to reverse swing from James Pattinson late in the day. De Villiers is still there, and it is the world's top-ranked batsman who offers Smith a sliver of hope in his role as a spectator on his last day as a Test cricketer.

He spent the first half of his penultimate day in the field with a grim face as Warner made hay with quick runs needed in the second innings, his favourite match situation, as England's bowlers will ruefully confirm. The left-hander hit 13 fours and four sixes in following his first innings of 135 from 152 balls with 145 off 156, giving him an aggregate of 543 in the series at an average of more than 90.

Clarke's declaration left South Africa needing a nominal 511 for victory but more realistically with four full sessions to bat, plus a tricky half-hour before tea. Smith was given a standing ovation by the Newlands crowd as he emerged from the pavilion for the last time, and a guard of honour by the Australia team as he approached the middle, plus a handshake from Clarke – much as Ricky Ponting was by Smith and South Africa when playing his last Test, against the Proteas in Perth in late 2012.

Unfortunately for Smith, the similarities did not end there. Ponting had failed, continuing a poor run of form that contributed to his decision to retire, and Smith's dismissal, poking a short ball to Alex Doolan at short leg, left him with a miserable tally of 45 runs from his final series at an average of 7.5.

He had defended his first ball from Ryan Harris, then flicked his second for three, before Harris nipped one back to dismiss Smith's opening partner Alviro Petersen – a 100th wicket for the 34-year-old Queensland seamer, in only his 23rd Test.

Smith fell in the next over, and there was an unusual symmetry in his dismissal as he had also gone for three in his first innings in Test cricket 12 years earlier, also against Australia in Cape Town. But this lean series has not put much of a dent in his outstanding career record which ends with 9,260 runs in 116 Tests at an average of 48.7, with 27 centuries.