Ajmal claimed all five wickets as South Africa crawled to 139 for five by the close on day two. Vernon Philander (five for 59) had earlier took the ninth five-wicket haul of his 15-Test career as Pakistan were bowled out for 338.
But Philander's efforts - it was also his third five-wicket haul in four Newlands Tests - were put in the shade as Ajmal (five for 41) took charge in an unchanged 25-over spell.
The 35-year-old spun out the Proteas' much-vaunted batting line-up, albeit with the aid of some DRS controversy when Jacques Kallis was seemingly given out for the wrong decision. Umpire Steve Davis initially appeared to raise his finger for a catch at short leg and while Kallis' review showed he had not hit the ball, it was going on to flick leg stump.
That meant the decision stood as an lbw call, although there was further confusion when Kallis refused to walk. Davis was prompted to have a further discussion with third umpire Billy Bowden before the decision remained to Kallis' displeasure.
AB de Villiers (24) and Dean Elgar (11) were left with the rescue act after Ajmal proved his match-winning potential. After openers Graeme Smith and Alviro Petersen saw off the new ball, which has proved crucial this South African summer, Ajmal claimed both before tea.
Smith was the first of three DRS victims as he was trapped on the front pad sweeping before Petersen was caught one-handed by Azhar Ali at short leg. The key wicket of Hashim Amla arrived just after tea as again South Africa were on the wrong end of the HawkEye technology - the right-hander adjudged lbw playing back to a ball that was hitting leg.
South Africa's frustrations were more tangible, however, when Kallis was then controversially sent on his way before Faf du Plessis edged a ball that straightened to Younis Khan at slip. That left the hosts on 109 for five before De Villiers and Elgar nervously saw out the remaining 16 overs to stem their troubles.
Earlier, Philander had given the hosts the early edge as he claimed three quick wickets to complete his five-wicket haul. Asad Shafiq defied the hosts for five hours on Thursday but he could only last one ball from Philander as he edged to Smith at first slip without adding to his overnight 111.
Philander then quickly accounted for Sarfarz, thanks to a stunning diving catch low to his right from Petersen at third slip, and Umar Gul to leave Pakistan 268 for eight. Tanvir Ahmed (44) and Ajmal (21no) then combined in a 64-run stand for the ninth wicket to push the score beyond 300. Tanvir was eventually caught by Philander at mid-off before Mohammad Irfan was trapped lbw.
- Sports & Recreation
- Vernon Philander
- Jacques Kallis
- South Africa