Fawad Alam celebrated his first Test at his home ground at National Stadium, Karachi with a stunning century to power Pakistan into a commanding position.
Securing his third Test century and the second in the space of a month, Fawad stood tall and negotiated the threat of South Africa's bowlers on a tricky surface with wonderful mastery.
His three-figure score at the highest level once again begged the question over his decade-long absence from the Test set-up.
The more incredible part of Fawad's innings was the way in which he reached the landmark score - stepping out of the crease to launch a tremendous six over long-on off Keshav Maharaj.
The dazzling effort was embellished with a spate of healthy contributions from Azhar Ali, Faheem Ashraf and Mohammad Rizwan as Pakistan staged a remarkable comeback in the Karachi contest.
The preceding day's play had Pakistan on the ropes after a spectacular top-order collapse as the hosts were reeling at 33/4 by stumps.
Barring the match situation, much of the attention was centred on Fawad's fairytale story - a triumph of perseverance and grit in the face of unjust selection policies.
Fawad's path to 109 was not all rosy as he was dealt blows to the wrist and body but remained unnerved by the target at hand.
He began Pakistan's pursuit of South Africa's first-innings total with a cautious approach and later steadily increased the frequency of attacking shots to flatten the opposition.
South Africa did fluff a tough chance offered from the bat of Fawad when he edged the ball to slip and Dean Elgar could not get his hands to it in time.
While Fawad stole the limelight with his brilliant heroics, Pakistan benefitted from Azhar's calm, balanced disposition at the crease as he blunted the effect of Kagiso Rabada's thorny six-over spell in the morning.
Rabada was left stranded at 199 Test wickets by the end of day two since a couple of difficult chances created from his bowling did not result in a scalp for him.
The wicketless first session was proceeded by Azhar falling victim to Maharaj as he shaped to cut a ball that was perhaps a bit too full for this shot.
The pressure built by the loss of Azhar faded away as Rizwan took charge and blasted boundaries with ease. There was reverse swing generated by the South Africa quicks but Rizwan feasted on the lacklustre lengths to pummel six boundaries in his 33.
The game still hung in balance at the tea break with Pakistan in a bit of a bother at 178/6. The 42-run advantage held by South Africa could not be contained for long as Faheem and Fawad seized the initiative and launched a flurry of aggressive strokes.
The Proteas did manage to prise out Faheem and Fawad towards the end of the day but they struggled to skittle the hosts and are now staring at a minimum of an 88-run deficit.