South Africa beat Pakistan by an innings and 92 runs in the second and final cricket test in Dubai, levelling the series at 1-1.
Pakistan were bowled out for 326 in their second innings with Asad Shafiq top-scoring with 130 while skipper Misbah-ul-Haq made 88.
The win also maintained South Africa's seven-year unbeaten run in series away from home since losing in Sri Lanka in 2006.
Part-time right-arm offbreak bowler Jean-Paul Duminy finished with three for 67 while Imran Tahir took three for 98 and took a total of eight wickets in the match.
Pakistan won the first test by seven wickets in Abu Dhabi.
The teams will play a five-match one-day international series starting on Wednesday, followed by two Twenty20 games.