PRETORIA - An imposing century from skipper Babar Azam spurred Pakistan to snatch a last-ball, three-wicket win over South Africa in the first one dayer of a three-match series on Friday.

Babar scored 103 off 104 balls to lay the foundation for his side’s success at the Centurion as Pakistan scored 274-7 in reply to South Africa’s 273-6.

Rassie van der Dussen hit an unbeaten 123 for the home side after they were put into bat but his efforts proved to be in vain.

Azam featured in a 177-run partnership for the second wicket with opener Imam-ul-Haq, who scored 70.

The 26-year-old Azam produced a stunning array of strokes to emphasise his ranking as one of cricket’s top ODI batsmen.

The pair looked to have taken the game away from South Africa, although three quick wickets for Anrich Nortje put a temporary brake on Pakistan’s march as they slumped from 186-2 to 203-5.

Forty runs for Mohamed Rizwan and Shadab Khan’s 33 put them back in charge and Pakistan needed just three runs off the last over to win.

But they made heavy weather of securing success before Faheem Ashraf secure a single off a wide delivery to secure victory.

South Africa struggled initially and had been reduced to 55-4 before Van der Dussen and David Miller put on a 116-run partnership for the fifth wicket.

It ended when Miller went tamely after a brisk 50 off 56 balls but Van der Dussen and his next two partners -- Andile Phehlukwayo and Kagiso Rabada -- added 102 more runs off the last 14 overs to set a decent target.

The next ODI will be played in Johannesburg on Sunday.

(Writing by Mark Gleeson in Cape Town; Editing by Pritha Sarkar) ((mark.gleeson@thomsonreuters.com; +27828257807; Reuters Messaging: mark.gleeson.thomsonreuters.com@reuters.net))