Pakistan squeaked past South Africa in the first ODI, securing a three-wicket victory with just three balls to spare at Boland Park in Paarl.

The tourists were indebted to the all-round performance of Salman Agha, who claimed four wickets and an unbeaten 82 with the bat to help his side to victory in the opener of a three-match series.

That had seemed a long way off for Pakistan when South Africa opted to bat in perfect conditions after winning the toss. The hosts made 70 in less than 10 overs before the fall of Tony de Zorzi (33), while fellow opener Ryan Rickelton (36) went for just another three runs – both bowled by Salman.

Man of the moment Salman wrapped up his first ODI four-wicket haul inside 14 overs, having also skittled Rassie van der Dussen (eight) and Tristan Stubbs (one) to leave South Africa reeling at 88-4. Resistance came in the form of Heinrich Klaasen (86), with the Proteas setting a target of 240 to win.

But Pakistan's chase got off to a dismal start, with Abdullah Shafique going for a duck in the second over, before a mini-collapse later saw them add just 14 runs for three wickets to slump to 60-4.

Yet that brought Salman back into the middle, and his 141-run partnership with opener Saim Ayub (109) set Pakistan back on course.

Even after Kagiso Rabada claimed Saim's wicket, Salman pushed on to complete the job, fittingly clinching victory with a ruthless four in the final over.

Data debrief: Inspired Salman drags Paklstan to victory

Man of the match Salman was largely responsible for saving Pakistan and had to reach new heights to do so, his score of 82 not out beating his previous ODI best of 58.

His bowling figures of 4-32 were also a career mark, with only Abrar Ahmed (3.20) more economical (4.00).