Pakistan 144 for 2 (Azhar 12*, Younis 21*) trail South Africa 380 (Smith 100, Amla 80, Kallis 73, Petersen 67, Gul 3-100) by 236 runs
Scorecard and ball-by-ball details

Pakistan fought back valiantly on the second day in Dubai as Umar Gul sparked a South Africa collapse to 380 before Taufeeq Umar and Mohammad Hafeez responded with an opening stand of 105. Gul, the one remaining frontline quick after Wahab Riaz suffered a side strain, struck three early blows before the spinners completed the resurgence. South Africa regained ground during the final session with the scalps of both openers but Younis Khan and Azhar Ali remained firm.

The worst news for Pakistan came shortly before play started as, for the second day running, they lost a key player. On Friday it was Mohammad Yousuf and now Riaz was ruled out of the series with the injury he picked up late on the first evening. Yet, just as things looked like falling apart they picked up with Gul inspiring the turnaround during a fine spell of 3 for 15 in eight overs and South Africa lost their last eight wickets for 73 runs.

But despite their end result being considerably lower than expectations, Pakistan's recent top-order woes suggested Graeme Smith's side would soon be in the wickets. That wasn't the case, though, with Dale Steyn and Morne Morkel inconsistent during their first spells as Taufeeq and Hafeez brought up a rollicking fifty stand in the ninth over. Neither batsman was afraid to play his shots; Taufeeq drove handsomely down the ground while Hafeez pulled strongly against Steyn. It was rare period of free-scoring on a day that brought 213 runs in 88 overs.

Taufeeq, recalled to the Test side for the first time since 2006, built on a fine record against South Africa against whom he averages over 70 while Hafeez, who last played a Test in 2007 against this opposition, didn't take a backward step. It was a sharp contrast to the feeble efforts offered in England earlier this year, and within 10 overs Smith was forced into containment mode.

This is where South Africa started to claw back as after tea they managed to string together maidens and increase pressure on the batsmen with the run-rate steadily falling from five-an-over to under three. The opening pair brought up Pakistan's first century opening stand since Imran Farhat and Salman Butt added 109 at Sydney, in January, but it wasn't a surprise when Hafeez advanced at Paul Harris and lamely chipped a catch to mid-on.

By now, Taufeeq was becoming seriously stalled. At tea he had 36 off 74 deliveries but managed just six runs from his next 45 balls as Harris and Johan Botha probed away. A return to pace brought his downfall when Morkel went round the wicket and gained an lbw decision although the point of impact raised some doubt. Morkel was much improved, striking Younis on the helmet in a tight six-over spell, and South Africa gave away only 58 runs in 35 overs during the final session. Still, it was as comfortably Pakistan's day.

South Africa began in rich health at 311 for 3, but the picture changed considerably in the morning session as the scoring rate was strangled and wickets fell regularly. Gul's spell was the stand-out display, but the role played by Younis was equally vital as he filled the hole left by Riaz with some rarely seen medium-pace, and his seven overs cost just 11.

Harris, the nightwatchman, was the first to depart when he pushed outside off stump and Younis snapped up a sharp chance at second slip. Harris's 42-minute duck set a new record for South Africa and, as is often the case, nabbing the nightwatchman early gave the fielding side a lift. Kallis had clipped an early boundary off his legs but the scoreboard came to a standstill with just three boundaries struck in the opening session despite Pakistan's depleted resources.

South Africa could have shown more intent, especially against Younis, but it was excellent bowling that changed the complexion of the game. AB de Villiers received a cracking off-cutter from Gul which nipped back between bat and pad to take off stump. Gul struck again in his next over, when he trapped Ashwell Prince back in his crease, and although the batsman didn't appear impressed with the decision, replays showed it pitched on leg stump.

Mark Boucher briefly broke the stranglehold when he drove Younis through mid-off but it continued to be painful going for South Africa. Younis and Gul were rested after their hard work, yet the pressure didn't let up as Rehman struck with his second ball to have Boucher lbw with one that went straight on.

From aiming at a total around 550, and the prospect of batting once in this Test, South Africa were suddenly seeing 400 as the limit of their ambitions. Even that proved unreachable when Kallis's obdurate display ended with an outside edge off Ajmal. Moments before lunch Rehman claimed his third when he straightened one past Johan Botha's prod and Ajmal then trapped Morkel with a doosra. One good day doesn't make a series, but yet again Pakistan managed to pull out a performance when it was least expected.

Andrew McGlashan is an assistant editor at Cricinfo