Pakistan 226 (Shafiq 75, Misbah 40, Perera 4-63) and 380 for 8 dec (Ali 136, Shafiq 100*) drew with Sri Lanka 337 (Paranavitana 75, Perera 75, Junaid 5-70) and 195 for 4 (Sangakkara 74*, Chandimal 65, Ajmal 3-50)

Scorecard and ball-by-ball details

Dinesh Chandimal reaches his half-century AFP

Smart stats Sri Lanka won their first series since the 2-0 win over New Zealand in 2009. Between then and the start of this series, they had lost five series and drawn three series.

Pakistan, on the other hand, lost their first series since the 3-1 defeat in England in 2010. It is also Pakistan's second consecutive series defeat in Sri Lanka after the 2-0 loss in 2009.

Asad Shafiq's century is his second in Tests and the first against Sri Lanka. He has now scored 894 runs at 42.57 with two hundreds and six fifties.

The 81-run stand between Shafiq and Adnan Akmal is the third-highest partnership for the ninth wicket for Pakistan against Sri Lanka.

Kumar Sangakkara's aggregate of 490 runs in the series is the highest by a Sri Lankan batsman in a home series against Pakistan. It is the fifth-highest series aggregate overall for a Sri Lankan batsman.

With another half-century, Sangakkara took his tally of fifty-plus scores against Pakistan to 17. He equals Sunil Gavaskar's record for the most fifty-plus scores against Pakistan.

A placid track on the fifth day provided Sri Lanka an ideal chance of pushing for victory by chasing down 270 in the allotted 71 overs, a result that looked a strong possibility after an aggressive start led by Dinesh Chandimal. But his dismissal at the stroke of tea slowed down the innings considerably and, despite a fluent Kumar Sangakkara at one end, Sri Lanka's focus turned to securing their 1-0 lead. The change in approach squeezed the excitement out of the chase, but succeeded in ensuring Pakistan lost a Test series for the first time since that ill-fated tour of England in 2010. It was also Sri Lanka's first Test series win in nine attempts since August 2009, and the first after the retirement of Muttiah Muralitharan.

Misbah-ul-Haq declared immediately after Asad Shafiq reached his second Test century prior to the lunch break. Shafiq added an unbeaten 81 with Adnan Akmal, who batted bravely with a broken finger to keep Sri Lanka at bay for more than 28 overs. In their defence of a target of 270, an all-out attack led by Junaid Khan was Pakistan's big hope of levelling the series, but with the pitch a contrast to days one and three, it was the batsmen who dictated the flow of the game.

When they came in for the chase, Sri Lanka had the option of batting out time instead of pushing for a win, given their series lead, but Chandimal's naturally positive approach delivered a promising start. Junaid and Umar Gul got a hint of movement with the new ball, and there were plays and misses. Tharanga Paranavitana reached out to a couple of wide deliveries, while Chandimal, against a round-the-wicket line from Junaid, was squared up by the away-going ball. His tendency to initially shuffle across and fall over gave Junaid a healthy chance of an lbw dismissal, but Chandimal middled the ball well. He slashed Gul through point, drove him down the ground and pulled him through square leg, all in the over before lunch.

Chandimal was largely cautious against spin, preferring to see off both Mohammad Hafeez and Saeed Ajmal, who only got the odd ball to turn, but was quick to seize on opportunities presented by the seamers. Despite the presence of a deep point, Junaid was thrashed twice through the cover region, also prompting the bowler to go back to bowling over the wicket. As the field spread out, he pulled short deliveries towards deep square leg, drove past mid-off and ensured a steady flow of singles and twos. Sangakkara gave him solid company in an 88-run stand.

Sangakkara joined Chandimal after the opening pair had added 44 at more than four an over. On a pair, he got going quickly, cracking an incoming delivery from Junaid through extra cover and cutting him past point. Fumbles, byes, overthrows, and singles were in supply, and Sri Lanka were going along smoothly, but Chandimal was keen to press on. After he'd launched Ajmal over mid-off for four, he tried repeated that feat in the over before tea, but failed to clear Shafiq, who held on to a sharp catch.

Even though Mahela Jayawardene fell playing a paddle-sweep, an attempt at improvisation, he'd consumed 43 balls before his dismissal. The first nine overs after tea yielded just 12 runs, that sense of urgency on show before lunch having disappeared. Sangakkara whipped Junaid for a couple of boundaries through midwicket, but any signs of the chase being revived proved deceptive.

The arrival of Thilan Samaraweera with 123 needed in 23.2 overs, ahead of power-hitters in Angelo Mathews and Thisara Perera, was the first reality check. His struggles against the doosra continued until he was bowled by Ajmal after facing 20 balls. His dismissal was followed by three consecutive maidens, consigning the game to a draw. The chase was called off nine overs short of the scheduled close.

Shafiq's assured century before lunch had given Pakistan a fighting chance. Sri Lanka failed to pick up a wicket with the opposition eight down, and an injured player batting at one end. Had they looked to close the innings early, targeting both batsmen instead of just Akmal, they would have had a better chance of forcing a result in their favour. But they employed spread fields to Shafiq, who batted calmly in the company of Akmal, who proved more than capable of surviving.

After the first hour of the day, a message came out from the dressing room to step it up and Akmal played the reverse-sweep for four, while Shafiq slog-swept Rangana Herath for four more. Amid a spate of singles through square leg, midwicket and on the off side, Shafiq also struck Perera through long-off and deep extra cover, before getting a top-edge to the fine-leg boundary. He brought up three-figures half an hour before lunch. At tea, Sri Lanka were favourites. But their priorities changed after that.