With the dry pitch already looking like a turner, Pakistan elected to bat after winning the toss. The South Africans started brightly, with Kagiso Rabada's fast in-swinger trapping Abdullah Shafique in front off the third ball of the day.
But the visitor's early jubilation was quickly diminished by the stoic Imam-ul-Haq and captain Shan Masood. The pair took the shine off the ball and began to collect runs at will. There were a couple of half chances in the field, with Tony de Zorzi nearly grabbling a stunner at short-leg and Wian Mulder putting one down after a full-length dive at cover.
But ultimately, ul-Haq earned his 50 off 65 balls and Masood followed with his half century after lunch.
The 161-run partnership was finally broken in the 47th over. Prenelan Subrayen - one of three spinners in the Proteas attack - bowled a straight one that got the better of Masood and hit the pad on the knee-roll. The captain reviewed but was eventually given his marching orders for 76.
Crowd favourite Babar Azam and ul-Haq continued to pile on the runs until an inspired over from Senuran Muthusamy. First, de Zorzi took a sharp catch under the helmet at short-leg to get rid of ul-Haq, who fell agonisingly short of his 100. The next delivery, a leading edge from Saud Shakeel looped to a grateful Muthusamy. He'd have to wait until after tea for his hat-trick ball, which was defended amicably by the new man Mohammad Rizwan.
Simon Harmer then struck right after tea, dismissing Azam via LBW, leaving the hosts 199/5 after they were 199/2.
That brought Salman Agha to the crease. Together with Rizwan, the pair should great application and patience against the spinners. Even the reintroduction of Rabada could not alter their steely resolve and the duo were unbeaten at the close of play, their sixth-wicket stand worth 114 vital first innings runs on a deteriorating pitch.