After bowling Pakistan out for 99 on the opening day thanks to 5-32 from leg-spinner Imran Tahir, South Africa captain Graeme Smith amassed 234 and AB de Villiers 164 as the Proteas put together a first innings score of 517 and lead of 418.
Pakistan is now 4-132 at stumps on Day 3 to still be trailing by 286 runs with only six wickets in hand with captain Misbah-ul-Haq not out on 42 and Asad Shafiq on 28.
However, the day's action was forced to take a backseat to the South Africans being penalised for ball tampering.
Television replays showed South African fielder Faf du Plessis rubbing the ball on a zipper on his trousers.
Umpires Rod Tucker of Australia and England's Ian Gould called over Smith, changed the ball and added five runs to Pakistan's score. Pakistan was struggling at 3-62 with Dale Steyn about to start the 31st over when the umpires took the decision.
Under International Cricket Council (ICC) rule 42.1 on tampering, if an umpire spots a change in the condition of the ball but doesn't know who is the culprit, he will issue a first and final warning to the captain and the ball will be changed.
But in this case the umpires saw du Plessis rubbing the ball in an apparent move to affect it and they imposed the penalty.
"As per 42.1 of the ICC playing conditions, the umpires replaced the ball and fined South Africa five penalty runs for ball tampering," said an ICC spokesman.
De Villiers was quick to deny the charges after the day's play.
"Honestly, we're not the team that scratches the ball," said de Villiers.
"We play in a fair manner, obviously we want to swing the ball as much as you can and try to get it reverse, putting sweat on the one side and stuff like that, we don't cheat, it's as simple as that.
"I know Faffy very well, he's the last man to try anything like that, it is part of his responsibility to shine the ball and to get it to swing and to look it after, it's not an easy job, I thought he did it very well."
Asked if the incident shocked the Proteas, de Villiers replied, "Honestly I don't know what happened there, I don't even know from where the message came from, obviously very surprised.
"There was no talk about it, no warnings and nothing, it was just out of nowhere, I don't know the facts, I have said what I had to say about Faf and it's pretty much about it."
Pakistan is the only other team to have been penalised with five penalty runs, during the infamous Oval Test against England in 2006.
Former Pakistan pacemen Waqar Younis, Shoaib Akhtar, all-rounder Azhar Mahmood and leg-spinner Shahid Afridi have all been banned for tampering in the past.
India's Sachin Tendulkar and England's Mike Atherton were also suspended and fined for tampering.
As for the match itself, South Africa started Day 3 on 4-460 with Smith not out on 227 and de Villiers 157.
The pair only managed to add 12 more runs on Friday morning before de Villiers fell for 164 when caught behind by Adnan Akmal off Mohammad Irfan.
Smith also added just the seven runs to his overnight score before falling for 234 when caught by Younis Khan off Saeed Ajmal.
The rest of the South African batting line-up failed to add much with only du Plessis making double-figures ending up 17 not out before the Proteas were all out for 517.
Ajmal bowled a mammoth 55.5 overs for Pakistan and the off-spinner finished with figures of 6-151. Irfan took 3-102 and left-arm spinner Zulfiqar Babar 1-124.
Any hopes Pakistan had of getting stuck in for the fight of at least trying to make South Africa bat again was over just about before it even started with Shan Masood gone for a duck in the first over and then Khurram Manzoor also falling without scoring in the second over.
It was a strong opening spell from Dale Steyn and Vernon Philander for South Africa before it took part-time spinner JP Duminy to break a 46-run third wicket partnership between Azhar Ali and Younis Khan when Ali was trapped in front for 19.
Younis and his captain Misbah then added another 22 runs for Pakistan before Younis was bowled by Tahir for 36 with Pakistan 4-70 before Misbah and Shafiq then survived until stumps to get their team to 4-132 and still needing 286 more runs just to force South Africa to bat again.