Lasith Malinga took five wickets in the space of 14 deliveries to ensure Sri Lanka made a winning start to this year's Asia Cup at the expense of Pakistan.
The Sri Lanka seamer returned to the attack in the 45th over with Pakistan dangerously-placed on 250-5 in pursuit of their 297 victory target.
But Malinga, whose opening seven overs had cost 40 runs, saved the day, removing Shahid Afridi (4) and Misbah-ul-Haq (73) in his first over back before ripping through the tail.
Malinga finished with match-winning figures of 5-52 as Pakistan were dismissed for 284 in the penultimate over.
While Malinga proved the hero with the ball, it was Lahiru Thirimanne's century which had earlier laid the platform for Sri Lanka's total of 296-6 batting first.
Thirimanne posted 102, his second three-figure score in ODIs, sharing a 161-run partnership with Kumar Sangakkara for the third wicket, who himself made 67.
From 189-1 Sri Lanka would have been eyeing a total well in excess of 300, but Pakistan battled back through spinners Afridi (2-56) and Saeed Ajmal (1-50).
Mahela Jayawardene, playing in his 600th international match, was bowled by Afridi for 13 and only some powerful lower-order hitting from Angelo Mathews (55no) saw Sri Lanka towards 300.
Pakistan made a solid start to their run-chase with openers Sharjeel Khan (26) and Ahmed Shehzad (28) adding quick runs at the top of the order.
But Sri Lanka looked strong favourites when Sachithra Senanayake reduced Pakistan to 121-4 with the wicket of Sohaib Maqsood, bringing Misbah to the middle alongside Umar Akmal.
The pair immediately launched a spirited counter-attack, Akmal blasting seven fours and three sixes in his top-scoring knock of 74 before edging Suranga Lakmal behind.
Misbah appeared to have the run-chase under control, but his demise, caught at deep square-leg, exposed the tail, who were found wanting by the irrepressible Malinga.