Graeme Smith made a double-century and AB de Villiers passed the 150 mark as South Africa piled on the misery for Pakistan on day two of the second Test in Dubai.
Smith reached the close on 227 not out while De Villiers was unbeaten on 157, their combined efforts helping the Proteas to a seemingly unassailable lead on 460 for four - 361 runs ahead.
Smith, who had reached 67 overnight on his return to action from a five-month injury lay-off after ankle surgery, recorded his 27th Test hundred before lunch, and reached his fifth double-century in the evening session as Pakistan's bowlers toiled without reward.
De Villiers had joined his captain at the crease when nightwatchman Dale Steyn had been bowled by Mohammad Irfan in the morning session, and together they settled in to give their hosts a long, punishing day.
De Villiers survived a few close calls when he was almost caught by wicketkeeper Adnan Akmal after edging Irfan and came through a couple of lbw appeals, requiring a review to overturn a decision in the evening session, but the glimmers of hope were few and far between for Pakistan.
They had won the first Test of the two-match series in Abu Dhabi but the Proteas - who last lost an away Test series in Sri Lanka in 2006 - put themselves on course to level after Imran Tahir's maiden five-wicket Test haul on Wednesday, when he finished with five for 32 as Pakistan were bowled out for just 99 in 36.4 overs.
Pakistan were hoping for an early breakthrough when play resumed with South Africa at 128 for three, and got it when Steyn was out for seven.
However, the hosts then saw the chance to send De Villiers straight back to the pavilion go begging when Akmal could not hold on to a thick edge.
There was another let-off for the South African batsman in the 71st over when Saeed Ajmal appealed for lbw, which was rejected by umpire Rob Tucker despite Ajmal seemingly having a strong case. Pakistan had already used all of their allocated reviews.
De Villiers went on to make 26 from 59 balls, including three boundaries, in support of his captain with an unbeaten 64-run partnership before lunch.
The morning session, though, was dominated by Smith, who brought up his 27th Test century in the 73rd over when he drove a full ball from Ajmal down the ground.
Pakistan took the new ball as soon as they could following the restart, but it did not change the momentum of the match as Smith and De Villiers continued to pile on the runs with 72 coming in the first hour.
There was, though, some concern for the Proteas in the 93rd over when Smith was caught on the head by a short ball from Irfan, and needed some attention from the physio.
De Villiers brought up his 17th Test century just before tea when he lofted Zulfiqar Babar over cover.
He was then given out lbw to Ajmal early in the evening session, but after conferring with Smith he appealed successfully, with replays showing the ball would have spun down leg side.
The South African pair swiftly resumed normal business, and Smith reached his double-century with a chipped shot over midwicket off Babar, celebrating his 9,000th Test run in the process.
Eleven overs later he had a scare of his own when Pakistan appealed for a catch in the slips, but Pakistan's review failed.
The only question from then on was whether or not South Africa might declare and take a shot at Pakistan before the close, but with Smith only 50 runs shy of his Test best 277, achieved against England in 2003, and plenty of time in the match, they had every reason to see it through to stumps.