Sri Lanka kept their Asia Cup title defence alive as they beat Pakistan by two wickets in an edge-of-the-seat thriller on Thursday to book their place in Sunday's final against India.
Electing to bat in the rain-marred contest, Pakistan posted 252-7 in 42 overs following half-centuries by Mohammad Rizwan and Abdullah Shafique.
Kusal Mendis kept Sri Lanka's chase on track but it was Charith Asalanka's unbeaten 49 which helped them clinch the last ball thriller.
The Super Four contest between the tournament co-hosts had effectively become a semi-finals after both lost to India.
Electing to bat, Pakistan lost Fakhar Zaman early while skipper Babar Azam (29) fell just when he was looking set.
Shafique (52) and Rizwan (86) steadied the innings and Iftikhar Ahmed (47) produced a breezy cameo down the order to take them past the 250-mark.
Shadab Khan caught Pathum Nissanka off his own bowling and then ran out Kusal Perera to peg back Sri Lanka but the collapse Pakistan wanted did not materialise.
Mendis (91) and Sadeera Samarawickrama (48) forged a 100-run stand to put Sri Lanka's chase back on track.
Samarawickrama was on 41 when he was hit flush on his helmet while trying to pull a rising delivery from Shaheen Afridi.
The batter dropped his bat and helmet and sank to his knees clutching his forehead.
While he was cleared to continue, Samarawickrama was soon dismissed. He was stumped with Iftikhar breaking the partnership.
Iftikhar (3-50) also denied Mendis a hundred and removed Dasun Shanaka before Afridi claimed two wickets in two balls to turn the match on its head.
Needing six runs from the last two balls from debutant Zaman Khan, Asalanka hit a streaky boundary and then ran two to complete a nervy chase for his team.