South Africa won a Test series against Pakistan 1-0 after the second Test was drawn on Friday.
Pakistan, set a mammoth 457 to win, finished on 316-4 with Younis Khan scoring a brilliant 130 on the fifth and final day at the Gaddafi Stadium.
Mohammad Yousuf was unbeaten on 63 and captain Shoaib Malik on 20 when both teams agreed to end the match with little chance of a result.
The draw handed South Africa their first series in the subcontinent since they defeated India in 2000.
They won the first Test in the two-match series by 160 runs in Karachi.
Pakistan's most experienced batsman, retiring Inzamam-ul Haq saw a dream shattered as he made only three -- and failed to break Javed Miandad's all-time record of most Test runs for Pakistan at 8,832.
Inzamam, who was stumped by Mark Boucher off left-arm spinner Paul Harris in the final Test, finished with 8,830 runs in 120 Tests.
Khan added 161 runs for the second with Kamran Akmal (71) and another 89 for the third wicket with Yousuf. He was finally dismissed, caught behind off Jacques Kallis after a fighting 350-minute knock.
He hit 16 boundaries during his match-saving innings.
The two teams start the five-match one-day series here from October 18.