At stumps on day one of the Old Trafford Test, England were positioned 260 for six.
England made 362 and bowled South Africa out for 226, wrapping up the South African first innings early on Day 3.
Anderson will return on Sunday one wicket short of his 23rd career five-for, and his first in front of the James Anderson end.
The left-hander - dropped by Dean Elgar at slip on 15 off Keshav Maharaj - reached his fifty off 49 balls in glorious fashion by lofting the spinner for a straight six that was safely pouched by team-mate Jonny Bairstow on the England players' balcony.
With England 200-7 at Old Trafford, leading by 336 and in the 63rd over of the day, Ali opened up and launched a huge drive over the top of bowler Keshav Maharaj towards the pavilion.
After England started their second dig, Morne Morkel removed both Alastair Cook and Tom Westley with the aid of gully catches.
'Jab Harry Met Sejal' is a darkly amusing romance
This time around, Aamir Khan extended his best wishes for Shah Rukh Khan for his forthcoming film that releases tomorrow. Both Shah Rukh and Imtiaz need the film to work at the box office as they have not tasted success for some time now.
Another individual who may find his involvement with England end with the series, temporarily at least, is Keaton Jennings.
England appear likely to be looking for a new bowling coach ahead of the Ashes after it emerged that Ottis Gibson, now in the position, is set to take over as South Africa's new head coach.
The England and Wales Cricket Board (ECB) have said they had not received any approach from Cricket South Africa (CSA) for Ottis Gibson amid reports he was poised to become the Proteas' new head coach.
In reply, England's openers, Cook and Jennings, started cautiously against the twin new-ball threat of Morkel and Kagiso Rabada - nearly too cautiously in Jennings' case, who, after failing to get off the mark from his first 13 deliveries, poked uncertainly down the line to Rabada, and squirted a fast but eminently catchable chance into the cordon.
England lost yet another wicket before tea - that of Stokes.
Bavuma (46) misjudged by leaving a ball which cut back in to take his off-stump.
Olivier bagged his third wicket when Bairstow (10) picked out Rabada at deep backward square, pulling with neither power nor timing, and Roland-Jones (11) also fell taking on the short ball having fended off a devilish Rabada delivery only for Du Plessis to spill a superb effort when his elbow struck the turf.