DUBAI, United Arab Emirates: South Africa inflicted an innings and 92-run defeat on Pakistan in the second test on Saturday and preserved its seven-year record of not losing a test series away from home.
Asad Shafiq made 130 with 15 fours and a six while captain Misbah-ul-Haq scored 88 before part-time spinner Dean Elgar broke through and Pakistan was eventually bowled out for 326 late on the fourth day.
South Africa got a massive lead of 418 runs by compiling 517 in its first innings in reply to Pakistan's paltry 99.
Shafiq and Misbah shared a 197-run stand for the fifth wicket and thwarted South Africa for nearly the entire two sessions before the Pakistan captain played a rare lose drive and was caught in the slips just before tea. Misbah faced 218 balls and hit six fours and a six in his marathon effort.
Pakistan's tailenders then fell to the spin of JP Duminy (3-67) and Imran Tahir (3-98) with 9.5 overs to go in the day's play.
Shafiq faced 320 balls during his seven-hour effort before he was the last man to go, stumped by AB de Villiers off Duminy.
No. 11 batsman Zulfiqar Babar couldn't come out to bat after damaging his right hand while fielding.
South Africa lost the first test -- also inside four days -- by seven wickets last week. But Saturday's win means the top-ranked team has not lost a test series since losing to Sri Lanka in 2006.
Earlier, Misbah and Shafiq frustrated South Africa for nearly four hours after Pakistan resumed at 132-4.
Shafiq cut, pulled and drove with authority and reached his second test century against the Proteas this year when he drove a wide delivery from Duminy to the cover boundary for his 11th four of the innings.
He also hit a century at Cape Town in February during Pakistan's 3-0 series defeat against South Africa.
On a day when Faf du Plessis was fined 50 percent of his match fee for ball tampering, South Africa struggled to break through on the dry wicket. Captain Graeme Smith took the second new ball just before lunch but both batsmen played out the four overs from fast bowlers Dale Steyn and Vernon Philander without much discomfort.
Pakistan had added only nine to its overnight score when Shafiq was adjudged leg before wicket in the fifth over of the day off Philander's sharp delivery.
But Shafiq went for review, which showed the ball would have missed the leg stump.
Shafiq lofted legspinner Tahir over long off for a six in a rare show of aggression during the morning session and completed his half century off 121 balls. Misbah also consumed as many deliveries when he glanced seamer Morne Morkel to the third man boundary for his 22nd 50 in test matches.
The teams now face each in five one-day internationals, starting Wednesday.