Sri Lanka 248 for 8 (Mathews 80*, Chandimal 54, Tanvir 3-42) beat Pakistan 247 for 7 (Farhat 56, Akmal 55*, Mendis 2-30) by two wickets

Scorecard and ball-by-ball details

Angelo Mathews and Nuwan Kulasekara celebrate a hard-fought victory AFP

Smart stats Sri Lanka's two-wicket win is their narrowest margin of victory against Pakistan (in terms of wickets). It also equals their closest win in terms of the number of balls remaining (two balls).

The target of 248 is also the highest chased by Sri Lanka in ODIs against Pakistan at the Premadasa stadium. Overall, it is the third-highest target chased by any team at the venue.

The series win is Sri Lanka's third in their last four series (bilateral series) against Pakistan. Their previous two series wins were 2-1 in Pakistan (2009) and 3-2 in Sri Lanka (2009).

Angelo Mathews' 80 is the highest score in a chase by a Sri Lankan batsman against Pakistan at the Premadasa stadium and the third-highest for them against Pakistan at the venue.

Mathews' strike rate of 105.26 is the highest for a Sri Lankan for a fifty-plus score against Pakistan at the venue.

Umar Akmal's half-century is his 15th in ODIs and fifth against Sri Lanka. He averages 51.27 against Sri Lanka while his overall average is 38.48.

This is the fifth occasion that Mahela Jayawardene has been dismissed for a first-ball duck.

Mohammad Sami conceded 75 runs off 9.4 overs. This is fourth-highest on the list of most runs conceded by a Pakistan bowler against Sri Lanka and the highest by a Pakistan bowler in Sri Lanka.

Pakistan's journey to defeat in the final game that decided the series was an emotional ride, which had several moments of satisfaction and relief, but ultimately ended in frustration and regret. The satisfaction was because of a significantly improved batting performance that cast aside memories of a dispiriting collapse in the previous ODI, they experienced relief after wriggling out of difficult situations they'd created, the brief-but costly-spells of wayward bowling were a source of frustration, but the emotion that will linger will be the regret of an insipid fielding display that undermined each forward step. Amid all this, Angelo Mathews was a figure of calm and assuredness, and not for the first time he rescued Sri Lanka from trouble and fashioned a thrilling victory with the tail.

Not quite the "tail", since Sri Lanka's No. 9 - Jeevan Mendis - has nine first-class hundreds. Nuwan Kulasekara did his bit too, but Mathews' presence was the key. With his team on 138 for 6 in the 35th over, Pakistan were the favourites. Mathews didn't flinch. He was selective in the balls he picked to dispatch, displayed confidence in his lower-order team-mates, indulged in a lot of touch-play and placement to work the gaps, all the while reminding his opponents that his was the decisive wicket.

Those reminders weren't enough to prevent Pakistan from letting their guard down. Outfielders failed to prevent twos that should have been ones, and those inside the circle failed to run the batsmen out at least three times, missing their targets as the chase approached a thrilling end.

With 12 needed off five balls, Mohammad Sami - replacing the "rested" Saeed Ajmal - bowled a juicy length ball that Mathews launched over long-on. Another poor throw and two runs later, with four needed off three, Mathews cracked a short ball over point to seal the win.

There had been several mini-conferences between overs, parallel discussions between fielders, all summing up Pakistan's struggle to close the lid despite climbing to positions of advantage. The run-outs of Thisara Perera and Lahiru Thirimanne deprived Mathews of two capable partners, but Pakistan were in for a surprise soon when Mathews ceded floor to Mendis, who kickstarted the counterattack.

Just when the required-rate had gone past nine an over in the 44th, Mendis smashed Sohail Tanvir's slower ball for six over long-on before driving and glancing Umar Gul for two boundaries. Tanvir eventually got rid of Mendis, but Kulasekara hung on, even collecting a fortuitous boundary past third man off Sami. The pair of Kulasekara and Mathews knocked off six singles in the penultimate over, leading up to Mathews' final surge in the 50th that included another missed run-out.

While poor ground-fielding produced the reprieves towards the end of the innings, it combined with poor catching in the first half. Misfields and a ball kicked for four in the outfield preceded a straightforward catch dropped off Kumar Sangakkara on 25 by wicketkeeper Sarfraz Ahmed. The run that lapse conceded brought about a half-century stand between Sangakkara and Dinesh Chandimal. It had helped Sri Lanka recover from two early blows inflicted by Tanvir, who castled Tillakaratne Dilshan and Upul Tharanga. Even though Sarfraz reacted sharply to run out Sangakkara for 36, the Pakistani heads continued to sink in their hands as the fielding woes didn't stop.

Chandimal, too, was given a life on 35 when a mistimed pull off Gul in the 30th over was put down by Azhar Ali at deep square leg. Ali was several yards in and failed to hold on as he back-pedalled and was unable to keep his balance. Chandimal went on to score a further 19 runs, those extra runs proving a major contribution in the outcome.

Pakistan replaced an experienced Younis Khan with Imran Farhat, who opened the batting and delivered to make a fluent fifty, with shots relying heavily on wristwork and backed up with flourish. He built a solid partnership with Ali, who then formed a steady association with Asad Shafiq. Each of the three batsmen, however, gave their wickets away - Farhat and Ali were caught off avoidable shots while a moment's hesitation for a single accounted for Shafiq.

Umar Akmal gave the innings impetus with his attacking, unbeaten 55. He thrice flicked Lasith Malinga past short fine, struck Perera for two sixes and promised to take Pakistan past 260. At 220 for 6 in the 44th over, that was well within reach. Akmal was picking Malinga's slower ones, but that changed soon as the seamer got his yorkers on the mark. Akmal made room, moved across, swung hard, tried to scoop, but Malinga had the better of the contest at the death. His thrift ensured Akmal managed only nine runs off his last 19 balls, and Pakistan just 27 off the last six overs. It would hurt Pakistan in the end, but not as much as their fielding.