|Second Test, Cape Town (day five)|
|England 629-6 dec & 159-6 Bairstow 30*, Root 29, Piedt 3-38|
|South Africa 627-7 dec: Amla 201, Bavuma 102*|
England survived a top-order collapse on day five as the second Test against South Africa ended in a draw.
Resuming on 16-0, a second-innings lead of 18, the tourists lost their top four cheaply and then fell to 116-6 as Ben Stokes and James Taylor departed.
But Jonny Bairstow and Moeen Ali held on before bad light ended play after tea with England, who lead the four-match series 1-0, on 159-6.
After the match, Hashim Amla stepped down as South Africa captain.
|Read more on the second Test|
|South Africa now a handful for England|
|Amla resigns as South Africa captain|
|Podcast - Test Match Special reviews the day|
The 32-year-old, who succeeded Graeme Smith as permanent skipper in July 2014, left the role having led his team in 14 Tests, winning four, drawing four and losing six.
Amla, who cited the need to "work on my own game", will be replaced as captain by AB de Villiers for the final two Tests.
Amla's 707-minute 201 in South Africa's first innings was one of the reasons a draw was always the likely result after four days dominated by the bat on a flat Newlands wicket.
But England made hard work of it, as the loss of early wickets gave South Africa hope of levelling the series after the tourists' victory in the first Test in Durban.
For the first time in the match, cloudy conditions in the morning offered something for the bowlers - and the home side took advantage.
Captain Alastair Cook was the first to go, feathering his second ball from Kagiso Rabada down the leg side and into the gloves of Quinton de Kock.
He was soon followed by fellow opener Alex Hales, brilliantly caught one-handed at third slip by the diving Chris Morris off Morne Morkel.
Cook's eight means he has now scored just 42 runs in his four innings so far this tour, while Hales' dismissal further highlights his fallibility outside off stump.
Joe Root and Nick Compton rallied slightly, adding 36 for the third wicket, but both fell as they were gaining momentum - the former bowled by Morris for a run-a-ball 29 before the latter chipped spinner Dane Piedt to short mid-on to depart for 15.
After smashing a record-breaking 258 from 198 balls in the first innings, Stokes was required to demonstrate a more disciplined side to his game along with Taylor, but both fell to Piedt in quick succession - Stokes misjudging a sweep to Morkel at deep mid-wicket and Taylor gloving a rising delivery to Temba Bavuma at short-leg.
The depth to which England bat was their salvation, chiefly in the shape of Bairstow, who followed his 150 not out in the first innings with an unbeaten 30 during a stand of 43 with the equally resolute Moeen (10 not out).
The partnership was not without its scares, most notably a stumping of Bairstow off spinner Dean Elgar, over which the video umpire took an age before deciding the Yorkshire player had made his ground by a toe's length.
Having survived to tea, during which light rain briefly fell, the pair were only required to bat six overs of the evening session before bad light brought an early end to the match, with 59 eventful overs bowled in the day.
Former England batsman Geoffrey Boycott on BBC Test Match Special: "South Africa have confidence now and England have a contest on their hands in Johannesburg.
"Hales looks extremely vulnerable outside off stump, he got caught on the crease and was eventually out. And Dale Steyn could come back if he's fit, and he's even better than Morkel.
"The catching is the worst aspect for England. They perhaps just need to treat this as a bad match for catching and hope to do better in the next Test. I don't think they can do much with their team, but the top order needs to be better."
'A little bit nervous' - what they said
Alastair Cook: "It was a little bit nervous. It's amazing when only one side can win it, the pressure is all on one side. South Africa bowled well. It would have been really disappointing not to bat out the day.
"On the first day it was a really good cricket wicket, but the pace slowly died. The partnership between Stokes and Bairstow accelerated the game. It was outstanding, a privilege to watch.
"The bowlers put the ball in really good areas. We played against some really good batting. To get 600 when you have conceded 600 is a really good effort from them. It might have been different had we taken our chances."
Hashim Amla: "It was nice to get some runs again. It's one of the best places in the world to play and we were pleased to see so many supporters here.
"Bavuma's innings was exceptional. He's been under pressure with people doubting his place in the team, but he's got real talent and we're all pleased the way he showed that.
"The next two matches should be really exciting. Both teams are evenly matched but we've got more positives to take into the next match."
Cricket analyst Simon Hughes: "This will be remembered as Ben Stokes' match. I don't think we'll ever see such sustained dominance again.
"Even watching him today was exhilarating. The talent he has, the way he picks up length, the simple execution of his shots, it's exquisite and he can match bravado with delicate precision.
"He's got the lot, and to top it he's a really nice bloke. He's an absolute gem."
A record-breaking Test in numbers
163 - balls taken for Ben Stokes' 200
461 - balls taken for Hashim Amla's 200
377 - dot balls in Amla's innings. He scored off just 100 deliveries
11 - Stokes' English record of sixes in an innings
2 - players to have faced 700 balls in a Test innings on more than one occasion. South Africa captain Hashim Amla and England captain Alastair Cook
3 - century partnerships in South Africa's first innings. They did not manage a single one in 2015
7 - bowlers that conceded more than 100 runs in an innings in the match
7 - dropped catches by England in the first innings
2004 - The year England last bowled more than 200 overs in an innings
29.90 - Alastair Cook's average in South Africa. His lowest anywhere in the world
85,095 - fans in attendance over five days at Newlands