Smith scored 105 as South Africa overcame England's total of 267 for eight with five balls to spare on Friday, the hosts securing only their second one-day international victory in the last 15 matches to level the seven-match series at 1-1.
Smith, who faced 131 balls and hit nine fours, received good support from Herschelle Gibbs who scored 50 in a third-wicket stand of 107 but the captain enjoyed his fair share of luck.
Smith was 53 when he attempted to on-drive a delivery from medium pacer Paul Collingwood and was dropped by acting captain Marcus Trescothick at mid-off.
Smith also escaped being run out for 58 when wicketkeeper Geraint Jones broke the stumps without the ball after Kevin Pietersen lobbed an underarm throw from mid-wicket.
The skipper was finally dismissed in the 42nd over when left-arm spinner Giles trapped him lbw with a turning delivery.
AB de Villiers, Nicky Boje and Jacques Kallis were dismissed cheaply in the space of 10 overs before Smith and Gibbs began their stand.
The partnership lasted until the 39th over, when Gibbs was lbw to fast bowler Darren Gough.
Smith's dismissal was followed two balls later by Justin Kemp being bowled by Collingwood for nine and South Africa lost three wickets for 10 runs in 21 balls.
South Africa had lost three wickets in the final over of the last match to allow England to escape with a tie but Mark Boucher clipped 33 off 21 balls to take the hosts to within 11 runs of victory.
He was trapped in front by Gough in the 48th over but Ashwell Prince smashed Gough through long-on for four to clinch a rare win for South Africa.
Vikram Solanki scored his fourth one-day half-century to lead England to a competitive total, but South Africa fought back to take five wickets for 60 runs in the last 11 overs.
Solanki, who replaced ill captain Michael Vaughan to play his first match of the series, scored 66 off 87 balls and hit four fours.
Fast bowler Andre Nel performed with his trademark aggression to take three for 49.
Makhaya Ntini found his discipline after conceding 11 runs in his first two overs, finishing with three for 58.
Solanki added 50 with Jones for the second wicket, 57 with Andrew Strauss for the third and 51 off 44 balls with Pietersen for the fourth.
Solanki came to the crease in the 10th over when Trescothick was caught by Smith for 33 after sending a ball from Nel looping over the bowler's head off the leading edge.
Nel dismissed Solanki in the 40th over, when the batsman heaved a delivery to AB de Villiers at long-off.
Jones scored 39 before being caught and bowled by left-arm spinner Boje, Strauss was out for 35 when his top-edged pull to a ball from Shaun Pollock flew to Prince at square leg, and Pietersen made 33 before pulling a ball from Nel to Gibbs at wide mid-on.
Scores: England 267-8 in 50 overs (Vikram Solanki 66). South Africa 270-7 in 49.1 overs (Graeme Smith 105, Herschelle Gibbs 50).