Asalanka brought the home team to the 252-run objective and brought the tense contest to a thrilling conclusion.
Charith Asalanka batted patiently, even though it was up to him to get his side across the finish line in the final few overs. He maintained his composure.
At one point during the last over, the match was in favor of the away side, thanks to Zaman Khan's brilliance, as they just needed to defend six runs in the last two balls.
But the second-to-last ball of the game, which Asalanka got an outside edge on, touched the boundary line.
When Zaman bowled a slower-length ball on the pads, Sri Lanka needed two off one. But the left-handed batsman remained composed and struck a straightforward drive towards the deep square leg barrier, celebrating as he raced two across the pitch to lead his team to a historic victory.
He discussed his reasoning for the last-ball triumph during the post-game ceremony.
"I just thought, How can I get two to hit a gap and run hard because it is a big field? and just told Pathirana to run hard. I thought either he would bowl a bouncer or a yorker, and then he bowled a slower ball, so it was on my side. I am very excited. Mendis and Sadeera batted really well. I wanted to finish. That is my role. I can rank this inning in second place in my book," he said.
A key 100-run combination between Kusal Mendis and Sadeera Samarawickrama gave their team a commanding advantage.
Mendis was caught after reaching 91 runs, while Samarawickrama was caught by Iftikhar Ahmed, needing only two more runs to reach his half-century total.
Iftikhar performed admirably for his team both with the bat and the ball, taking three crucial wickets, yet his valor was in vain.
When Pakistan batted first, Mohammad Rizwan and Iftikhar combined for 252 runs on the scoreboard for their team.
Rizwan played an unbeaten 86 off 73 balls with nine boundaries, and Abdullah Shafique, the second-highest scorer for the Green Shirts, hit his first ODI half-century.
Earlier, Pakistan chose to bat first after winning the toss. Due to rain, the game was first cut to 45 overs and later to 42.