Pakistan's innings was built around a brilliant 122 from Mohammad Hafeez which saw them post an impressive total of 5-322 in their 50 overs but were made to work hard for their win, finally bowling Sri Lanka out in 49.4 overs.
Hafeez, whose place was in danger over poor form after only 147 runs in the last eight one-dayers, hit seven boundaries and four sixes in his seventh one-day hundred which came off just 129 deliveries.
Besides Hafeez's 122, Sohaib Maqsood (73) and debutant opener Sharjeel Khan (61) were the main contributors on a flat pitch.
Sri Lanka had all but lost the match at 7-221 but Sachithra Senanayake (42) and Seekkuge Prasanna (42) gave Pakistan a scare during their 87-run partnership for the eighth wicket -- a record for Pakistan-Sri Lanka one-day internationals.
Sri Lanka needed 27 off the last two overs but both the batsmen were out in quick succession to hand Pakistan a deserved win.
Pakistan captain MIsbah-ul Haq said his bowlers needed to improve on this performance.
"It was a hard fought win. We need to improve on the bowling and fielding, too many lapses," said Misbah.
Sri Lankan captain Angelo Mathews was full of praise of his team's battling display.
"We witnessed a great match, especially the stand between Seekkuge and Senanayake, very pleasing to see how they fought," said Mathews.