South Africa beat Pakistan by 28 runs in the fourth day-night international in Abu Dhabi on Friday to take an unbeatable 3-1 lead in the five-match series.
Chasing a challenging 267-run target, Pakistan were bowled out for 238 in 49.2 overs with Dale Steyn taking a career best 5-25.
Misbah-ul Haq top-scored with 65 while debutant Sohaib Maqsood made 56.
For South Africa, opener Quniton de Kock hit a maiden hundred with 112 while Hashim Amla(46) and AB de Villiers (30) were other contributors.
The fifth and final match is in Sharjah on Monday.
Brief scores: South Africa 266-5 in 50 overs (Q. de Kock 112); Pakistan 238 in 49.2 overs (Misbah-ul Haq 65, Sohaib Maqsood 56; D. Steyn 5-25).