Fast bowler Gus Atkinson, who scored his maiden first-class hundred in England's first innings, led the attack with 5-62
In Sunday’s final, Pakistan will meet the winner of Friday’s semifinal between Sri Lanka and West Indies.
Shahid Afridi starred for Pakistan by striking 51 in the total of 149-4. Then he took 2-16 as previously unbeaten South Africa was limited to 142-5.
Pakistan batted its last five overs without scoring a boundary, but South Africa failed to keep up with the run rate.
After 10 overs South Africa was 61-3 and though opener Jacques Kallis survived an appeal for caught behind in Afridi’s final over, the 13th, the required run rate had increased to nearly 11.
Sensing the danger, Kallis went for broke when Fawad Alam came on to bowl the 15th over, which went for 15.
But Umar Gul bowled the 16th and nearly ran out JP Duminy from the first ball and limited South Africa to just six runs.
Needing 39 from 18 balls, Kallis tried to hit Saeed Ajmal into the River Trent at the start of the 18th over, but his slashing innings ended for 64 off 54 balls when he was caught at long off by Shoaib Malik.
Gul restricted Duminy and Albie Morkel to six from the penultimate over, meaning 23 were needed from the final six balls from 17-year-old medium-pacer Mohammad Aamer.
Duminy missed the first, but hit the second for six. From the third he tried to come back for a second run but Alam’s direct throw ran out Morkel for 2. Aamer fumbled the chance of a run out from the fourth, and Duminy smacked four from the penultimate ball, and that left the Proteas needing an impossible 10 from the last delivery.
Aamer held his nerve, avoided bowling a no ball, and conceded just a boundary for Pakistan to reach the final.
Fast bowler Gus Atkinson, who scored his maiden first-class hundred in England's first innings, led the attack with 5-62
The 29-year-old hit 138 and brought Bangladesh back into the match with a fighting 165-run seventh-wicket stand alongside Mehidy Hasan Miraz
Alastair Cook and fellow former England skipper Michael Vaughan described Joe Root as England's 'greatest' batsman of all time
The captain for Men in Blue in the white ball format is Mohd Amaan and for the red ball format is Soham Patwardhan
The allrounder will remain as the captain in One-Day Internationals (ODIs)
Root drew level with fellow former England captain Cook's record of 33 Test centuries
Despite widespread calls for his ouster, Shakib is expected to feature in the second and final Test against Pakistan
Pope was twice out for six in the first Test