Ronan O'Gara scored all Ireland's points as the home side claimed only their second ever win over South Africa on an emotional day at Lansdowne Road.
Ireland: (8) 17
Pens: O'Gara 4
Drop goal: O'Gara 1
South Africa: (3) 12
Pens: Montgomery 4
O'Gara's first-half try, poached after a quick tap-penalty, helped the Irish to a 8-3 lead at half-time.
Three further O'Gara penalties extended Ireland's lead to 17-6 as the game entered the final quarter.
Two Percy Montgomery penalties set up a frantic finish but Ireland held out to claim a famous victory.
Ireland began strongly and were never led, but the match was tense and closely fought throughout.
Aware of the threat posed by the South Africans, Ireland pressed hard from the outset, and played some impressive rugby while searching for a breakthrough.
Early on, Denis Hickie thought he was in for a try after a delightful backline move but Shane Horgan's pass was adjudged to have gone forward by referee Paul Honiss.
Ireland continued to press and they showed their intent by opting for a line-out in the 19th minute when three straight-forward points were on offer.
Another South African infringement a minute later led to Ireland's first points - O'Gara took a quick tap-penalty and charged over the opposition line for an Irish try.
The Springboks could feel hard done by as captain John Smit had his back to the play when O'Gara pounced after referee Honiss had told the skipper to warn his own players after consistent infringements.
Stung by the score, the South Africans almost replied with a try of their own within 60 seconds with Geordan Murphy's ankle-tap tackle denying a certain try for Percy Montgomery.
However, the Springboks did win a penalty a minute later which Montgomery easily slotted to cut Ireland's lead to 5-3.
Paul O'Connell attempts a burst for Ireland
Ireland got out of jail when the South Africans had a three-to-one overlap near the Irish line only to waste the chance.
After the sustained Springboks pressure, the Irish produced an attack of their own in the 34th minute which culminated with O'Gara's clever drop-goal to restore his side's lead to five points which remained the margin at half-time.
Sustained Irish pressure immediately after half-time was rewarded by another O'Gara penalty.
However, Montgomery responded quickly by slotting over a superb penalty from near the right touchline to cut Ireland's lead to five points again.
Montgomery then burst through the Irish defence in the 48th minute and it took a superb Girvan Dempsey tackle to prevent a try.
The South Africans suffered a double-blow in the 52nd minute when Schalk Burger was sin-binned for the second week in a row after killing the ball and O'Gara punished the transgression by notching another penalty.
In the 61st minute, Hickie was left frustrated by a poor pass from Girvan Dempsey as a chance to seal the match was wasted.
However, a late tackle on Brian O'Driscoll enabled O'Gara to notch another penalty in the 63rd minute which extended Ireland's lead to 17-6.
However, two Montgomery penalties had Ireland's lead in peril again as the Springboks closed to within five points with seven minutes remaining.
South Africa produced a huge effort in the closing minutes but Ireland held on to claim a deserved victory.
Ireland: G Dempsey; G Murphy, B O'Driscoll (capt), S Horgan, D Hickie; R O'Gara, P Stringer; R Corrigan, S Byrne, J Hayes, M O'Kelly, P O'Connell, S Easterby, J O'Connor, A Foley.
Replacements: F Sheahan, M Horan, D O'Callaghan, E Miller, G Easterby, D Humphreys, K Maggs.
South Africa: P Montgomery; B Paulse, M Joubert, De Wet Barry, A Willemse, J
van der Westhuyzen; F Du Preez; O Du Randt, J Smit (captain), E Andrews, B
Botha, V Matfield, S Burger, AJ Venter, J van Niekerk.
Replacements: H Shimange,
CJ van der Linde, G Britz, D Rossouw, M Claassens, J de Villiers, G du Toit/J Fourie.
Referee: Paul Honiss (New Zealand)