Karachi:Paceman Dale Steyn piloted South Africa to a 160-run victory in the first Test against Pakistan with five second-innings wickets.
Pakistan - needing a world record run chase of 424 to win - was bowled out for 263 just before tea on the final day, handing it a rare defeat at the National Stadium.
No team in Test history had ever successfully chased such a large fourth-innings target.
West Indies retain the record of the highest ever chase when it defeated Australia at Antigua in 2003 by scoring 418 runs.
South Africa led by 159 runs after the first innings, and Jacques Kallis hit successive centuries in the second innings as the tourists declared at 264-7 for an overall lead of 423 runs.
Younis Khan made an aggressive attempt to have a shot at the target, scoring 126 off 160 balls.
But once Steyn clean bowled Khan before lunch on the last day, Pakistan lost its last six wickets for 66 runs in the afternoon session.
Captain Shoaib Malik (30) put up a fight in his first Test as captain before being the last man dismissed.
South African players celebrated when Andre Nel caught a skied shot as Malik top edged Makhaya Ntini for his only wicket of the match.
It was only the second time Pakistan had lost at the National Stadium in 40 Tests, with the first one being against England seven years ago.
Resuming at the overnight score of 146-3, Pakistan lost night-watchman Mohammad Asif (6) in the sixth over of the morning.