Pakistan tail-end batsman Zulqarnain Haider and Wahab Riaz pulled off a sensational one wicket win for their team over South Africa in the fourth one-day match after Younis Khan's fifty.
Younis's sedate 73 built Pakistan's run-chase but they owed it to their tail-enders Haider (19 not out) and Riaz (18) as they put on 28 runs for the ninth wicket to help their team chase down a challenging 275-run target, on Friday.
Fit-again Graeme Smith played a captain's knock of 92 to steer South Africa to a challenging 274-6 but once again his team choked in the final moments despite having grabbed all top wickets.
Pakistan still needed 31 when they lost Abdul Razzaq (33) -- whose robust 72-ball 109 not out which shocked South Africa by one wicket in the second match in Abu Dhabi -- but Haider and Riaz held their nerves.
Even when Riaz was run out with three needed off as many deliveries, Haider kept his cool, scoring two off paceman Wayne Parnell and then pulled the penultimate delivery for a single, much to the delight of a 25,000 capacity crowd.
The win helped Pakistan level the series at 2-2 and set up an intriguing fifth and final match on Monday.
It was Younis whose 115-ball half-cenury with only one boundary that put Pakistan on course for a tight run-chase, adding 58 for the second wicket with Mohammad Hafeez (42) and 56 with Asad Shafiq (36).
So cautious was Younis that his first boundary came in the 37th over, but he kept Pakistan on course with another 49 for the sixth wicket with Razzaq before paceman Morne Morkel dismissed both to finish with 3-48.
Captain Shahid Afridi also bolstered the run-chase with a swift 25-ball 29 studded with four boundaries.
Pakistan coach Waqar Younis praised his team's fighting ability.
"One should praise the game, it was a hell of a match and all praise to the boys who showed great fighting ability, especially Younis who batted well and the tail-enders who kept us in the hunt," said Waqar.
Earlier Smith missed his ninth one-day century by just eight runs on his return after injuring his hand during South Africa's eight wicket win in the first match in Abu Dhabi.
South Africa took a 2-1 lead with a narrow two-run win in the third match on Tuesday.
Smith put on a 94-run stand with AB de Villiers (49) to put South African on course for a big total before he was trapped leg-before by off-spinner Hafeez in the 31st over.
De Villiers then took charge alongwith Jean-Paul Duminy (36) as South African added 84 in the last ten overs. De Villiers's 70-ball knock was without a boundary but he batted sensibly after Smith's departure.
Smith said his team put up a good total but didn't bowl well. "A total of 274 was good," said Smith. "We needed to bowl decently but we didn't and gave the momentum to Pakistan and in the end we had a chance to win, but it didn't come about."