A career-best century from Mohammad Rizwan and a statement of intent from opener Abdullah Shafique ensured Pakistan broke a World Cup record to secure a second successive victory in the tournament.
Pakistan, who lost the toss and were asked to chase the match, saw its bowlers toil with Sri Lanka amassing 344 for nine in their allotted 50 overs.
Kusal Mendis smashed 122 off just 77 balls, ably supported by Sadeera Samarawickrama, who scored a brisk century of his own, making 108 off 89 balls to ensure Pakistan had a challenging total to overcome.
Pakistani bowlers toiled on a batting pitch. Strike bowler Hassan Ali took four wickets but at the cost of giving away 71 runs in his ten overs.
Shaheen Shah Afridi, whose brown patch continues, picked up a wicket while giving away 66 runs in nine overs.
Elsewhere, Haris Rauf picked up two wickets in his ten overs while giving away 64 runs. Mohammad Nawaz and Shadab Khan picked up a wicket each in very expensive spells.
Pakistan faced the daunting challenge of the highest-ever run chase in World Cup history to ensure victory in their second match.
Pakistani side, however, immediately found themselves in trouble, losing opener Imamul Haq for 12 in just the fourth over, followed by captain Babar Azam for 10 in the eighth over, with Pakistan reeling at 37 for two and the familiar dread of another batting collapse looming.
However, Abdullah Shafique and Mohammad Rizwan put on 176 for the third wicket partnership to ensure Pakistan had a fighting chance.
Shafique scored 113 runs off 103, while Rizwan remained not out at 131 off 121 balls.
After Shafique was caught, Rizwan and Saud Shakeel put on 95 for the fourth wicket to get Pakistan within touching distance of the target.
Rizwan and Iftikhar Ahmed then saw Pakistan overcome the total with consummate ease with ten deliveries to spare. They managed to complete the highest-ever run chase in a World Cup match. It was also Pakistan's highest ever run chase in a match away from home.
Rizwan was awarded the player of the match award for his match winning innings.
The match also created another record, with the two teams scoring a combined 689 runs, the most scored by these two teams together in an ODI.