PALLEKELE: Dinesh Chandimal hit an unbeaten 48 to guide Sri Lanka to a series-levelling two-wicket victory over Pakistan in the second one-day international in Pallekele on Wednesday.
Chasing Pakistan's challenging 287-8, the hosts recovered from 159-5 to post 288-8 with 11 balls to spare in a tense finish to the day-night match.
Pakistan v Sri Lanka 2nd ODI - As it happened
Chandimal led the fightback by adding 37 for the sixth wicket with Milinda Siriwardana (26), 52 for the seventh with debutant Sachith Pathirana (33) and 37 for the eighth with Thisara Perera.
Perera was eighth out when three more runs were needed for victory, but Lasith Malinga kept his cool amid mounting tension before Chandimal hit the winning run.
Pakistan had won the first match in Dambulla by six wickets last Saturday to take the lead in the five-match series.
Ninth-ranked Pakistan need a series win to stay in contention for a place in the eight-nation Champions Trophy in England in 2017.
Sri Lanka, currently ranked fifth, are assured of taking part in the tournament.
Opener Kusal Perera gave Sri Lanka a rollicking start with a breezy 68 off 25 balls that included 13 boundaries and two sixes.
The left-hander raced to 50 off just 17 balls, just one delivery short of equalling South African AB de Villiers' record for the fastest half-century in 16 balls.
Kusal matched his countryman and idol Sanath Jayasuriya's feat of a 17-ball 50 as he put on 92 for the first wicket with Tillakaratne Dilshan off just 8.2 overs.
But just when he appeared to have the Pakistani attack at his mercy, Kusal gifted his wicket by pulling fast bowler Mohammad Irfan to Yasir Shah on the square-leg fence.
Dilshan's 47 carried Sri Lanka to a commanding 140-1 in the 19th over when Pakistan hit back with four wickets for 19 runs, three of them in successive overs in the space of four runs.
Pakistan's innings revolved around three half-centuries, including a 52 off 38 balls by Mohammad Rizwan towards the end that boosted the total.
Azhar Ali played a captain's innings of 79 and senior pro Shoaib Malik made a run-a-ball 51, the pair adding 83 for the fourth wicket after the tourists won the toss and elected to bat.
But Rizwan stole the show with five boundaries and a six as the tourists plundered 88 runs in the last 10 overs.
Anwar Ali, who put on 56 for the seventh wicket with Rizwan, returned unbeaten on 29 off 20 balls. Pathirana and Malinga claimed two wickets each.
The third match will be played at the Premadasa stadium in Colombo on Sunday.