|In happier times: Pietersen congratulates Trott (left) on his fifty [AFP]
England survived a batting collapse to draw the first Test against South Africa at Centurion with one wicket in hand.
South Africa claimed five wickets in the last 15 overs to leave the visitors, who had been set 364 for victory, teetering on the brink of defeat on 218 for nine.
However, Paul Collingwood staunchly defended his wicket to score 26 off 99 balls and last man Graham Onions endured the last 3.1 overs to secure a thrilling draw for England, who finished on 228 for nine.
South Africa were favourites to win when they reduced England to 27 for three inside the first hour on the final day.
But the South African-born duo of Kevin Pietersen (81) and Jonathan Trott (69) seemed to have guided England to safety with their steely fourth-wicket partnership of 145.
South Africa first innings 418
England first innings 356
South Africa second innings 301-7 dec
England second innings
A Strauss c Boucher b Morkel 1
A Cook c Smith b Harris 12
J Anderson c Boucher b De Wet 10
J Trott c De Villiers b De Wet 69
K Pietersen run out (De Wet) 81
P Collingwood not out 26
I Bell c Boucher b De Wet 2
M Prior c Boucher b De Wet 0
S Broad c Boucher b Harris 0
G Swann lbw b Morkel 2
G Onions not out 1
Total (for 9; 96 overs) 228
FoW 1-5, 2-16, 3-27, 4-172, 5-205, 6-207, 7-208, 8-209, 9-218
Pietersen, who was aggressive throughout, collecting 11 fours and produced some breathtaking drives off the front foot, survived an lbw when the umpire called the delivery from Friedel de Wet a no-ball.
But he was run out in the second over after tea, opening up an end through which De Wet, assisted by the second new ball, burst through in an inspired spell of three for 11 in seven overs.
Left-arm spinner Paul Harris and paceman Morne Morkel chipped in with a wicket apiece as the match concluded in an electrifying atmosphere.
Pietersen and Trott steered England to 169 for three at tea.
Pietersen was run out after striking the ball into the off-side and setting off while Trott stayed out at the non-striker's end.
Trott and Collingwood carried England through to 201 for four when South Africa took the second new ball and the lower order cracked under the pressure.
AB de Villiers took a superb catch at third slip to dismiss Trott off De Wet.
Ian Bell (2) and Matt Prior (0) were caught behind by a diving Mark Boucher in successive overs by the debutant fast bowler, who finished with four for 55 in 23 overs.
Harris had Stuart Broad (0) caught behind and Morkel trapped Graeme Swann (2) in front of the stumps with a delivery that jagged back at the batsman and kept low, leaving England in dire straits.
But Collingwood, who produced a typically gutsy innings spanning 161 minutes and 99 balls, stood firm and Onions survived the final over from Makhaya Ntini, who was brought back at the death in his 100th Test.
England resumed their second innings on 11 for one and nightwatchman Jimmy Anderson (10) and opener Alastair Cook (12) were both dismissed in the morning session as the visitors slumped to 27 for three.
Anderson fell in the third over when De Wet fired in a lifter at his body and the batsman could only edge the ball down the leg side to Boucher.
Spinner Harris was in the attack after eight overs and dismissed Cook with his first ball to the left-hander, which made its way off his glove, on to the pad and then looped to Graeme Smith at leg slip.