South Africa 151 (Rabada 36, Anderson 3-32, Broad 3-37) and 23 for 0 trail England 415 for 9 dec (Foakes 113*, Stokes 103, Nortje 3-82) by 241 runs
Manchester: Sublime centuries from Ben Stokes and Ben Foakes gave England complete control of the second Test against South Africa after two days at Old Trafford.
Stokes' first hundred as captain and wicketkeeper Foakes' first at home took England to 415-9 declared, a first-innings lead of 264.
South Africa battled to 23-0 by the close, 241 behind.
Stokes and Foakes came together at 147-5 with England four runs adrift after Anrich Nortje removed Jonny Bairstow and Zak Crawley.
Their sixth-wicket stand of 173 has left England primed to level the series at 1-1 with one match to play.
Both men overturned lbw decisions, while Stokes was dropped on 92 before falling for 103.
Foakes was not out on 113 when England's declaration gave South Africa nine overs to survive in the evening sunshine.
Although openers Dean Elgar and Sarel Erwee came through, the Proteas face a huge task to even drag this contest into a fourth day.
After England resumed on 111-3, Nortje found reverse swing at high pace to have the poking Bairstow held at first slip for 49 then ended Crawley's resistance on 38 with a wonderful delivery that was edged behind.
The Stokes-Foakes rebuild was not based on the swashbuckling style favoured by England so far this summer, but through careful, correct and classical Test batting.
The gradual grinding down of the South Africa attack came on a pitch that is wearing quickly and delighted a boisterous crowd.
The name of James Anderson was sung as the local hero emerged to loosen up between innings and Anderson thought he had snared Erwee lbw, only for the left-hander to survive England's review.
All is not lost for South Africa. If they can in any way match England's effort with the bat, a fourth-innings target of 150 could prove tricky given the state of the pitch and quality of the touring attack.