A late flurry from Ben Stokes gave England the upper hand on day one of the second Test against South Africa.
On a true Cape Town batting surface, Alex Hales (60), Joe Root (50) and Nick Compton (45) all failed to kick on and England slipped to 223-5.
But Stokes flayed the second new ball in 74 not out from 93 balls to take the tourists to 317 without further loss.
Kagiso Rabada, the 20-year-old playing his fourth Test, took 3-74, but South Africa tired in the evening session.
Pace bowler Rabada had earlier characterised a South Africa performance improved on the 241-run first-Test defeat, as the Proteas kept England in check with wickets at important times.
But after captain Hashim Amla curiously used part-time bowlers with England five wickets down, Stokes capitalised on some poor bowling with the second new ball to move the tourists towards an imposing score on a pitch that looks likely to deteriorate.
The Stokes show
Although England had the advantage of batting first in ideal conditions, they looked set to end the day with nothing better than parity.
That was until Stokes set about attacking the second new ball, which at one point was costing South Africa nine runs an over.
Driving and cutting, Stokes helped himself to 11 fours and a six in an unbroken partnership of 94 with Jonny Bairstow, who made an unbeaten 39.
The England sixth-wicket pair were afforded the luxury of facing the likes of part-timers Stiaan van Zyl and Dean Elgar as Amla opted to save his frontline bowlers for the new ball.
The decision proved costly as England's late assault took the day away from the previously spirited Proteas.
"I don't want to be too critical but I don't think we're enamoured with Amla's captaincy," former England batsman Geoffrey Boycott told Test Match Special. "There are things he could have done better.
"England are the better side. I'll be surprised if they don't win."
England had earlier been guilty of wasting strong positions, with 129-1 and 167-2 eventually sliding to 223-5.
After Alastair Cook was brilliantly caught at third slip by debutant Chris Morris off Rabada, Hales showed he had learned from the mistakes of his debut in the first Test.
Demonstrating sound judgement around off stump, he picked up boundaries through mid-wicket and third man on the way to a maiden half-century before he edged a lovely delivery from Morne Morkel that seamed away from a difficult length.
Compton again looked solid, accelerating through the afternoon before he and James Taylor fell to successive Rabada deliveries either side of tea.
Root got England back on track, but even he had reprieves off Rabada on 13 and 23, dropped by the flying Morris and then getting into an ugly tangle to a bouncer, with the ball just landing safe of the diving AB de Villiers.
Rabada leads South Africa fight
While the surface could be trusted by the batsmen, it also encouraged the pace bowlers, none more so than the pacey and hostile Rabada.
Having already accounted for Cook and caused Root problems, he struck twice in as many balls to drag South Africa back into the contest.
Compton hooked a short ball straight to mid-wicket, then Taylor played an expansive drive to be caught behind by Quinton de Kock, who was recalled to the South Africa side for the omitted JP Duminy.
Root busily scored off the back foot, but when he wafted an edge behind to give Morris a deserved maiden wicket, the day was in the balance.
Enter Stokes and Bairstow, who counter-punched at five runs an over. Bairstow was lucky not to be bowled by a delivery from off-spinner Dane Piedt, but the turn only served to highlight the problems South Africa could face later in the game.
What they said
England batsman Alex Hales on Test Match Special: "When the second new ball was taken the game was pretty much in the balance, but the way Stokesie played has probably given us the upper hand.
"It was a hell of an innings and hopefully he can kick on tomorrow for a ton. It was a pretty even contest between bat and ball all day, but the way he came out and attacked that second new ball was unbelievable.
"The next two wicket partnerships are going to be massive. The way Mooen Ali, Stokesie and Jonny play, they can take the game away. Hopefully we can push on past 450."
South Africa pace bowler Chris Morris on Sky Sports: "We'll come back tomorrow and try and get back on as soon as I can. There's a lot of hard work ahead of us and we've got to fight as hard as we can."
Stats of the day
- Of the past 15 times that the visiting team have batted first in a Test at Newlands, they have been beaten on 13 occasions
- Alex Hales and Alastair Cook registered England's first 50 opening partnership in eight innings. England were averaging just 13.7 in that period for opening partnerships
- Hales is Cook's first partner to reach a half-century since Adam Lyth against New Zealand at Headingley in May 2015, 10 matches ago
- Joe Root has now made five Test fifties since he last went on to make a century