Opening batsman Imam-ul-Haq hit an unbeaten 50 to steer Pakistan home in the first Test against Sri Lanka on Thursday, passing their tricky target of 131 with four wickets to spare.
The tourists started the final day on 48-3 and lost three more wickets, including skipper Babar Azam for 24, to spinner Prabath Jayasuriya before reaching 133-6 in the first session in Galle.
Haq started the day on 25 and remained calm with Azam and then left-handed partner Saud Shakeel, who made a brisk 30 after his unbeaten 208 in Pakistan's first innings.
"When you win the match, you gain confidence," Azam said after Pakistan collected the 12 points on offer for the win in the new World Test Championship cycle.
"Credit to the boys and the youngsters."
Left-armer Jayasuriya took four wickets, including two in the final session on Wednesday, to give the hosts a glimmer of hope but Haq stood firm.
Azam came out roaring, hitting a boundary off the first ball of the day, and looked fluent in his 28-ball stay before being trapped lbw by Jayasuriya.
Shakeel also took on the bowlers but off-spinner Ramesh Mendis had him caught behind.
Haq reached his eighth Test fifty before Jayasuriya snared Sarfaraz Ahmed for one and Agha Salman came out to hit the winning six with his first ball.
Shakeel stood out for his maiden Test double century in Pakistan's 461 all out and a handy first-innings lead of 149 in the rain-hit match.
"It's not easy to bat here but the way Saud played was outstanding," Azam said of Pakistan's man of the match. "I wish him luck for the next match."
Shakeel and Salman, who made 83, put on a marathon stand of 177 for the sixth wicket after Pakistan lost early wickets in their first-innings reply. Azam said the partnership "totally changed the game".
Pakistan spinners Noman Ali and Abrar Ahmed made it count with three wickets each on Wednesday to help bowl out Sri Lanka for 279 despite Dhananjaya de Silva's stubborn 82.
De Silva made 122 in Sri Lanka's first innings of 312 after the hosts elected to bat first but soon Pakistan took control.
"We lost early wickets, as top-order batters we should contribute more. We should have contributed more and taken the responsibility," skipper Dimuth Karunaratne said.
He praised de Silva's batting, saying: "He takes the responsibility and always does what the team needs. The other guys need to step up and do better."
Pakistan pace spearhead Shaheen Shah Afridi took a match haul of five wickets on his return to Tests since a knee injury put him out of action a year ago at the same venue.
The second match of the two-Test series starts Monday in Colombo.