Pakistan have beaten South Africa by one run in the second one-day international in Port Elizabeth.
Chasing 264 to win the match, South Africa fell two runs short of victory in a game that was reduced to 45 overs per side due to rain.
After losing the early wickets of Nasir Jamshed and Mohammad Hafeez, Ahmed Shahzad hit 102 off 112 before he was run out by Imran Tahir.
Sohaib Maqsood posted a knock of 42 before he was caught out by Hashim Amla off the bowling of Ryan McLaren. Captain Misbah-ul-Haq made 12 before Tahir hit a quickfire 42 off 30 deliveries.
Pakistan lost the wickets of Akmal and Anwar Ali (7) in successive deliveries before they were bowled out for 263.
Dale Steyn claimed six wickets, while Ryan McLaren and Tahir claimed one each.
South Africa's chase took an early blow when Graeme Smith was caught behind by Umar Akmal for one. Quinton de Kock and Hashim Amla took the Proteas to 96-1 before the former was dismissed by Shahid Afridi for 47.
Following the dismissal of Jacques Kallis for six, AB de Villiers hit 74 runs off 45 balls before he was caught by Afridi off the bowling of Junaid Khan.
South Africa looked to be heading for victory but the quick dismissals of Amla (98) and JP Duminy (15) gave Pakistan hope.
Despite scoring four runs off the final ball South Africa fell just short of victory, giving Pakistan an unassailable 2-0 lead in the three-match series.