Fast bowler Kagiso Rabada took two wickets for just eight runs as he led a South African fightback against Pakistan in their first Test in Karachi on Tuesday.
Pakistan were in trouble at 33 for four at the close of play, having bowled out the visitors for 220 — their second-lowest total in the country.
Fourteen wickets fell on the brownish National Stadium pitch, which had been expected to take spin from day one.
South Africa were well placed at 108-2 soon after lunch, but lost their last eight wickets for just 112 runs — barely managing to overhaul their lowest total in Pakistan, the 214 made at Faisalabad in 1997.
Spinners Yasir Shah (3-54), debutant Nauman Ali (2-38) and pacer Shaheen Shah Afridi (2-49) did the damage.
But then Rabada paid back the hosts with interest, bowling Abid Ali (four) in his third over and then getting debutant Imran Butt (nine) caught at leg-slip off a rising delivery.
He now has 199 wickets from 44 Tests.
Babar Azam, leading Pakistan for the first time in a Test, fell lbw to spinner Keshav Maharaj for seven before night watchman Shaheen was bowled by Anrich Nortje without scoring.
At the close, Azhar Ali and Fawad Alam were unbeaten on five each — with Pakistan trailing by 187 runs with six wickets intact.
Earlier, opener Dean Elgar top-scored for South Africa with 58, while George Linde (35) and Rabada (21 not out) were other notable contributors.
While lamenting his side's poor batting, Elgar said South Africa now had the upper hand.
“I would not have said that after our batting, but then we fought back by taking wickets,” he said.
“Knowing that this pitch will get tougher, and knowing that we have good spinners, I am confident that we can get further ahead.”
Elgar struck his 16th Test half-century — laced with nine boundaries — before he edged Nauman into the hands of Azam at slip.
Elgar and Faf du Plessis (23) had steadied the innings during their 45-run stand for the third wicket after Aiden Markram (13) and Rassie van der Dussen (17) were dismissed in the first session.
South Africa entered the Test — their first in Pakistan in 14 years — with two spinners, Keshav Maharaj and George Linde, to exploit a bare pitch which is expected to take spin.
Pakistan handed Test caps to 34-year-old left-arm spinner Nauman Ali and 25-year-old opener Imran Butt in a combination of three pacers and two spinners.
Pakistan umpire Aleem Dar, who has officiated on-field in the most international games (391), is supervising his first test in Pakistan since making his debut in 2000.
Dar got his first opportunity at home after the International Cricket Council allowed the appointment of local match officials for international matches because of travel restrictions in place for the Covid-19 pandemic.
Babar Azam (captain), Abid Ali, Imran Butt, Azhar Ali, Fawad Alam, Faheem Ashraf, Mohammad Rizwan, Nauman Ali, Yasir Shah, Hasan Ali, Shaheen Shah Afridi
Quinton de Kock (capt), Aiden Markram, Faf du Plessis, Dean Elgar, Temba Bavuma, Kagiso Rabada, Keshav Maharaj, Lungi Ngidi, Rassie van der Dussen, Anrich Nortje, George Linde