Pakistan 33 for 4 (Rabada 2-8) trail South Africa 220 (Elgar 58, Linde 35, Yasir 3-54, Nauman 2-38, Afridi 2-49) bt 187 runs

Is it possible to dominate a day and walk off demoralised, fearing the next one? That might be how Pakistan view proceedings after an absorbing opening day of hard-fought Test cricket that should have left them well on top, but had a nasty sting lying in wait in the fading light in Karachi. Having bowled South Africa out in just over two sessions for 220, playing tricks on the visitors' mind with the ball and in the field, Pakistan should have found themselves sitting pretty. Instead, having lost their openers and Babar Azam cheaply in the final hour, they are perched precariously at 33 for four.

You could see why Pakistan wanted to prepare a surface that afforded as little assistance to the quicks as possible given the way Kagiso Rabada and Anrich Nortje tormented them after tea. While variable bounce was an uncomfortable weapon for Pakistan's spinners, it was downright lethal when Rabada used it, removing Abid Ali with one that kept low and debutant Imran Butt with another that reared up and took his glove. And just when it seemed there was nothing South Africa could do to salvage an incriminatingly ordinary batting performance, Keshav Maharaj popped up to trap Babar in front, while Nortje sent the nightwatchman Shaheen Afridi on his way in the next over.

Having won the toss, South Africa had opted to bat, and it looked like they had bought Pakistan's line about this being a series dominated by spin hook, line and sinker as they prepared to field three of their own. That Tabraiz Shamsi pulled up because of back spasms just before the toss might end up being a blessing in disguise for the impression the quicks would make towards the end of the day, and both sides went into the game with three seamers and two spinners.

Elgar and Aiden Markram welcomed Hasan Ali back to Test cricket with five fours in his first two overs to send South Africa off to a breezy start. That approach, though refreshingly entertaining, was punctuated by a couple of wickets, with Afridi getting one to seam away from Markram, Butt diving to his left at second slip to pouch the edge.

The wicket didn't stymie South Africa, with Elgar and Rassie van der Dussen keeping the scoreboard ticking. Well into the second hour, the batsmen had the edge before a moment of self-destruction handed Pakistan a wicket that might as well have been gift-wrapped. Van der Dussen set off for a single Elgar hadn't agreed to, and with the non-striker only turning him down after he was halfway down the pitch, Rizwan effected the run-out.

The game was blown wide open in a frantic middle session as Pakistan ran through a South African middle order whose plans to combat spin remained half-baked. It required a combination of Pakistani brilliance and South African self-destruction, with the visitors appearing to believe low-percentage attack against spin was an acceptable substitute for neutralising it. When Faf du Plessis was put down off the first ball after lunch, it seemed like an omen, and thus it proved when a magnificent Yasir Shah legbreak kissed his outside edge through to Mohammad Rizwan. South Africa tried to hit their way through the looming threat without looking convincing. Quinton de Kock fell hoicking Nauman Ali to wide midwicket - the shot needed no further criticism than the look of despair on the South Africa captain's face.

Elgar had put together a nifty little innings, never looking as susceptible against spin as the batsmen at the other end. When a couple of authoritative boundaries off Afridi took him to a half-century, he would have had thoughts of converting it into three figures, but poor shot selection struck once more. He tried to drive Nauman away from his body, playing for the turn that never happened, and offered first slip a straightforward catch.

George Linde and Temba Bavuma provided some resistance, but the self-destruct button was never far away. Minutes before tea, Bavuma found himself calling for a suicidal extra run, and when Hasan's throw from fine leg reached Rizwan, a valiant dive didn't prove enough. Pakistan's stranglehold would only deepen after tea, with the hosts skittling out South Africa inside the first hour of the final session. That South Africa managed to get to 220 was thanks only to a happy-go-lucky 25-run partnership between Lungi Ngidi and Rabada for the tenth wicket. Yasir ended with three while Afridi bookended the innings by claiming No. 11 Ngidi just as he had dismissed opener Markram.

Pakistan were walking off in full command. An hour later, they would walk off once more, having ceded all control to a South Africa side that had undone six hours of damage inside 18 spellbinding overs.

Danyal Rasool is a sub-editor at ESPNcricinfo. @Danny61000