The match was heading for a thrilling conclusion as Pakistan, chasing 165 for victory, were 137 for seven after 17 overs.
Dwaine Pretorius conceded 12 runs in the 18th over, four of them via an unfortunate edged boundary, but the experienced Phehlukwayo would have fancied his chances of still forcing the game to the wire as he stepped up to bowl the penultimate over with 16 runs to play with.
Unfortunately it all went horribly wrong as the seamer started with a full toss hit for six and called a no-ball, then bowled a wide two balls later, conceded a four and then delivered another full toss which was heaved for six by Hasan Ali (20* off 7 balls), as Pakistan dashed to victory by four wickets with eight balls to spare.
Phehlukwayo had also been caught on the boundary for a duck, as part of a dreadful collapse that saw South Africa crash to 65 for seven, and he was guilty of a few misfields that cost nine runs.
There was much to be pleased about for the Proteas in the field, however, as they fought back well, spearheaded by the superb spin bowling of Tabraiz Shamsi, who took four for 25, after Pakistan seemed to be cruising to victory as Mohammad Rizwan (42 off 30) and Babar Azam (44 off 30) took them to 112 for three after 14 overs.
South Africa’s batting against spin is still obviously a major issue though as, after being sent into bat, they were ripped apart by debutant leg-spinner Zahid Mahmood, who took three for 23 in his first three overs.
Left-arm orthodox Mohammad Nawaz also took a couple of wickets in the powerplay as the Proteas made the spinners look unplayable.
Fortunately David Miller survived the chaos and showed why he is still one of the best finishers for South Africa, scoring an exceptional 85 not out off 45 balls to get them to a competitive 164 for eight.
Bjorn Fortuin (10*) and Lutho Sipamla (8*) batted sensibly to enable Miller to add 99 runs for the last two wickets.