The Springboks kept their hopes of a record fourth title alive thanks to fly-half Handre Pollard's second-half points, setting up a last-four meeting with England back in Paris on Saturday.
France were knocked out at the quarter-final stage despite leading at the break in a huge disappointment for the expectant home support at the Stade de France.
"I just thought we really wanted it. I must give credit to the guys who came off the bench. They came and made a good defence," South Africa captain Siya Kolisi said.
"It was a hard game. We knew how tough it was going to be with the French team at home and honestly I just want to say well done to them for what they have achieved and how hard they worked."
France fly-half Matthieu Jalibert said: "We could have taken some chances in the second half but you have to congratulate the Springboks for resisting our attacks.
"There is a feeling of a lot of disappointment and frustration. It is sad and very disappointing for us... it is hard to accept going out."
French President Emmanuel Macron was among the 79,500 crowd expecting -- and getting -- a match of the highest quality between Fabien Galthie's France team, third in the world rankings, and Jacques Nienaber's Boks, in second place.
- All eyes on Dupont -
All eyes were on France captain Antoine Dupont, returning from a cheekbone fracture he suffered last month as the host nation eyed a first semi-final spot since they finished runners-up for a third time in 2011.
And 26-year-old Dupont was involved as the French opened the scoring, feeding Damian Penaud who found prop Cyril Baille with a deft pass in the corner to send the Parisian crowd wild.
Full-back Thomas Ramos made it 7-0 with the conversion and despite France seeming to be in control the Springboks reacted quickly as Kurt Lee-Arendse made the most of a bouncing box kick.
Manie Libbok, inconsistent from the tee so far this World Cup but picked ahead of World Cup-winning fly-half Handre Pollard at fly-half, then brought things level after 10 minutes to cap a breathless start to the game.
The Boks benefited from another high ball as center Damian de Allende crashed over a few phases after collecting a Libbok up-and-under, athough the fly-half missed the extras.
Dupont was again instrumental as he set up Peato Mauvaka for the mobile hooker's third try of the tournament.
Ramos' difficult conversion attempt was dramatically charged down by Cheslin Kolbe to make it 12-12 before the Boks took the lead again -- those spurned points would prove costly in the final result.
Lock Eben Etzebeth hassled Dupont at a ruck before center Jesse Kriel set up Kolbe with a grubber kick that he ran onto like an Olympic sprinter. Libbok slotted the extras and the clinical Springboks led 19-12.
An outstandingly open first 30 minutes was wrapped up with the sides level at 19-all as Baille claimed his double.
South Africa went in at the break down a man after Etzebeth was shown a yellow card for making head contact with Uini Atonio as he tackled the mammoth prop.
Ramos slotted the resulting penalty to leave France 22-19 up at the interval.
- Redemption for Etzebeth -
After just five minutes of the second half Cobus Reinach and Libbok were replaced by Faf De Klerk and Pollard as South Africa made tactical changes that would serve them well.
Etzebeth was booed by the French crowd as he returned from the sin bin.
France were controlling territory and possession as Ramos extended his advantage as the tournament's top scorer with a penalty to make it 25-19.
But the momentum swung back South Africa's way as Etzebeth made up for his earlier misdemeanour by crashing over for a try and Pollard's conversion put the Boks back in front at 26-25 going into the final 15 minutes.
Pollard, from his own half, traded a penalty with Ramos in a nerve-racking ending.
France had possession with the clock in the red, but De Klerk came up with a crucial rip of the ball from the grasp of Reda Wardi, Kurt-Lee Arendse booting the ball out to end French dreams of a first World Cup triumph.