The Proteas looked doomed when they crashed to 42-5 within the first hour before wicketkeeper Mark Boucher (69) and Justin Kemp (64) steadied the ship by adding 131 for the sixth wicket to help set a defendable total of 213-8.
The partnership was South Africa's best sixth-wicket stand against Pakistan surpassing the 88 by Jonty Rhodes and Dave Richardson at Durban in 1994.
South Africa made a terrible start in the key match when they lost half their side by the 13th over after captain Graeme Smith won the toss and elected to bat on a seaming wicket.
Justin kemp acknowledges a
However, their start seemed like a dream as Pakistan were themselves reduced to 27-6 before being bowled out for 89.
Makhaya Ntini was the destroyer after he grabbed 5-21 as the Pakistanis crumbled.
The right-arm fast bowler had Mohammad Hafeez caught by Smith at first slip with his second ball and had Imran Farhat taken at third man by Shaun Pollock in his next over.
Pollock celebrated his 100th one-day catch by bowling Mohammad Yousuf for five before Ntini dismissed captain Younis Khan and Shoaib Malik in his fourth over.
All was hope lost by the time Pakistan slipped to 42-7 in the 13th over when Ntini trapped Kamran Akmal leg-before and Pollock claimed Shahid Afridi (14) in the same fashion.
Pakistan's lowest total against South Africa - their previous low was 109 in Johannesburg in 1995 - undid the good work done by their bowlers in the first session.
Pakistan had decimated the South African top order after Umar Gul removed Smith and Herschelle Gibbs in the first over of the match as the ball moved alarmingly in the air and off the wicket.
Fellow-seamer Rao Iftikhar enjoyed the conditions as much as Gul, conceding his first run on his 19th delivery.
Iftikhar had Boeta Dippenaar (13) and Jacques Kallis (17) caught by wicket-keeper Akmal as the Proteas slipped to 36-4.
Another Pakistani wicket falls
But the bowlers made up for the batting lapses to earn South Africa a superb victory.
South Africa joined New Zealand in the semi-finals from group B with two wins each, topping the group on the basis of a superior run-rate.
The South Africans will travel to Jaipur for the second semi-final against the runners-up of group A on November 2.