Slow bowlers Imran Tahir and JP Duminy spun South Africa to a series-levelling innings and 92-run victory over Pakistan on day four of the second Test in Dubai on Saturday.
Asad Shafiq, who hit a career-best 130 to stall the South African victory charge, was the final wicket to fall when he was stumped by AB de Villiers off the bowling of Duminy.
He had put on 197 for the fifth wicket with skipper Misbah-ul-Haq (88) that frustrated the Proteas until an hour after lunch.
Pakistan were eventually bowled out for 326 in their second innings, a vast improvement on the woeful 99 they managed on day one, but still left them 92 runs shy of South Africa's mammoth 517.
Pakistan won the first Test by seven wickets.
The teams will now play a five-match one-day international series starting on Wednesday, followed by two Twenty20 games.
Photo: Getty Images
South Africa close in on series-levelling win against Pakistan
SA in command after Tahir sends Pakistan crashing for 99
We don't cheat and it's as simple as that, asserts AB de Villiers
England's Bopara was under ICC's radar for match-fixing
Amla, Steyn return to South Africa T20 squad