Teenager Umar Akmal smashed an unbeaten 102 off 72 balls as Pakistan won the fourth one-dayer by 146 runs to record their first win on a dismal tour of Sri Lanka.
Umar's maiden international century and a dogged 89 from skipper Younus Khan lifted Pakistan to 321 for five after the tourists elected to bat in the day-night match at the Premadasa stadium.
Seamer Rao Iftikhar then grabbed 30 for five as Sri Lanka were shot out for 175 in 36 overs and one ball, handing Pakistan a badly-needed win after they were beaten 2-0 in the Test series and lost the first three one-dayers.
The fifth and final match will be played at the same venue on Sunday.
Umar, 19, younger brother of the team's wicket-keeper Kamran Akmal, pounded four sixes and five boundaries in only his third international.
Younus stayed rock-solid at the other end as Umar punished the wayward Sri Lankan attack during a fifth-wicket partnership of 176 runs after Pakistan slipped to 130 for four.