Dubai:Opener Hashim Amla hit a fighting century and paceman Morne Morkel took four wickets as South Africa pulled off a narrow two-run win over Pakistan in the third day-night international on Tuesday.
South Africa, put into bat by Pakistan, owed it to the 27-year-old Amla who carried his bat through the innings with a resolute 119 and helped his team to a defendable 228-9 before surviving another scare by Pakistan who managed 226-9.
It was the bearded right-hander's sixth one-day hundred -- his fifth this year -- which brought South Africa back in the match after they struggled initially on a tricky Dubai Stadium pitch.
South Africa, who lost the second match in Abu Dhabi by one wicket after Abdul Razzaq's incredible 72-ball 109 not out, this time negated Fawad Alam's brilliant 59 not out which almost turned the tables again.
Rusty Theron kept his nerves to defend 12 runs in the last over as Pakistan lost two wickets and managed just nine runs.
Paceman Morne Morkel (4-47) had derailed Pakistan after opener Imran Farhat (47) and Asad Shafiq (43) added 85 for the third wicket to put Pakistan on course for a win, chasing just over four an over.
Farhat, who hit only one boundary off 86 balls, and Shafiq helped Pakistan recover the early loss of opener Mohammad Hafeez (four) and Younis Khan (nought) with the total on 13.
But both Farhat -- brought in in place of Misbah-ul-Haq as the only change -- and Shafiq were run out in sloppy manner to spoil the run-chase.
And when Shahid Afridi (seven) and Abdul Razzaq (12) fell, Pakistan had all but lost the match. Alam then added 33 for the eight wicket with Wahab Riaz (21) to revive Pakistan's hopes of an unlikely win but South Africa overcame last match jitters in the end.
Alam hit three boundaries off 67 balls.
South Africa were once again without their captain Graeme Smith who failed to fully recover from a hand injury sustained during his team's eight wicket win in the first match at Abu Dhabi on Friday, but all-rounder Jacques Kallis was included after recovering from injury.
Both captains praised Amla's knock.
"To keep it simple his was the best knock I have seen," said Johan Botha. "Amla was in total control on a pitch where others struggled and he gave us the sort of score which we thought was defendable."
Pakistan captain Afridi said Amla and his team's poor fielding were the difference.
"Amla was stubborn and we once again showed flaws in our fielding and gave away 30 extra runs which proved decisive in the end," said Afridi.
Amla put on a valuable 59-run fourth wicket stand with Jean-Paul Duminy (26) after Pakistani paceman Shoaib Akhtar put them on the back foot by dismissing Kallis (nought) and in-form Colin Ingram (four) early.
Amla, who has so far scored 986 runs in 13 one-day matches this year, held one end during his 126-ball knock, hitting nine boundaries to carry his bat through the innings.
Pakistani spinners - Shahid Afridi and Mohammad Hafeez - also benefited from the slow turn as they captured four wickets between them and never allowed South African batsman any room for free strokeplay.
Afridi had the dangerous-looking AB de Villiers and Albie Morkel - who both scored 19 each - during his 2-53 off ten overs, while Hafeez (2-34) accounted for Duminy and David Miller (6).
Amla added another valuable 38 with Johan Botha (15) before Akhtar dismissed Botha to finish with 3-39.
Both teams play two Tests -- one each in Dubai and Abu Dhabi -- after the one-day series.