Sri Lanka 280 for 4 (Dilshan 119*, Jayawardene 53) beat Pakistan 204 (Azhar 96, Perera 6-44) by 76 runs
Scorecard and ball-by-ball details

Tillakaratne Dilshan batted through the innings with a century to take Sri Lanka to 280. Azhar Ali looked set to match Dilshan's feat and nearly reached his maiden ODI ton. Ultimately though, it was Thisara Perera's six-wicket haul, aided by his own brilliant fielding, which helped Sri Lanka level the series after a disappointing showing on Thursday. Perera's efforts were all the more special because four of those wickets included top-order victims. In the process, he bagged the overall best bowling figures against Pakistan in one-dayers.

Pakistan gambled with their line-up by playing only five specialist batsmen in both games. It didn't matter in the first ODI, where they were chasing a paltry target. However, in their chase of 281, their over-reliance on Azhar bit them. As the required-rate increased, Azhar's own strike-rate dipped. None of the others passed 50, the next highest being 27.

Sri Lanka, on the other hand, didn't gamble with theirs. Thursday's batting meltdown necessitated a reshuffle and the change gave the hosts a greater sense of security. It was imperative that at least one of the seniors - who were struggling for consistency - batted through. Upul Tharanga returned to the position he's best known for, while Dinesh Chandimal was sandwiched between two experienced players to ease the pressure off his shoulders. It led to an efficient batting effort, led by Dilshan, who dropped anchor and batted with the intention of playing 50 overs. The foundation he provided allowed the likes of Mahela Jayawardene, dropping to No.5, the freedom to innovate in the slog overs.

A drier pitch, devoid of the moisture present in the first game, made life easier for the batsmen, allowing them to play across the line. Two boundaries whipped off the pads early on gave Dilshan the confidence to settle in and take on a leadership role at the top of the order. After looking like a walking wicket in the first ODI, he was more sure of his off stump and was prepared to leave deliveries angling across him. Sohail Tanvir troubled him with a few that beat the bat, but he played out his spell and cashed in when debutant left-arm seamer Rahat Ali strayed too wide of the off stump.

Dilshan shared shared stands of 37 with Tharanga and 47 with Kumar Sangakkara. Chandimal and Dilshan ensured the run-rate didn't drop after that dismissal, knocking the singles and scoring boundaries when the spinners, in particular, erred in length. A sweep off Afridi brought up Dilshan's fifty.

Afridi trapped Chandimal lbw but there was no respite for Pakistan as what followed was Sri Lanka's most productive partnership, of 86. Jayawardene, no stranger to unconventional shots, unsettled the spinners with a delicate late cut, a Dilscoop, a paddle sweep, reverse sweep and a conventional sweep.

Dilshan nudged and punched the singles during the stand, allowing Jayawardene to play the aggressor. Though Dilshan slowed down after getting his century, it didn't cause a slowdown because Perera tonked two fours and two sixes in a 14-ball 24 to lift Sri Lanka to a challenging score.

Pakistan got more than what would have expected from a makeshift opener. Azhar did well to shrug off the tag of being a 'Test-match player'. It was classical batsmanship on view as Azhar relied purely on timing to fetch his boundaries. With minimal foot movement, he managed to drive on the up and yet place it in the gaps through the off side. The pace at which he scored would have surprised Sri Lanka. The short of a length deliveries were punched off the back foot, while the fuller ones were driven through the covers.

Sri Lanka's seamers may have failed to make early inroads but Perera more than made up for that. He sent back Mohammad Hafeez off his first ball, flinging himself in the opposite direction of his follow-through to pull off a return catch. He then had Younis Khan nicking to the wicketkeeper and later sparked Pakistan's slide by trapping Misbah-ul-Haq lbw.

The boundaries dried up for Pakistan after the 20th over. Misbah's departure left the inexperienced Azhar marshaling the unpredictable Umar Akmal and Afridi, both of whom failed to turn the game around. Perera had Akmal caught behind - a doubtful dismissal - and then got rid of Gul to register his third five-wicket haul. The game was all but over when Azhar's leg stump was taken to pieces by a Nuwan Kulasekara yorker. Sri Lanka's emphatic comeback has set the series up nicely for the last three games in Colombo.

Kanishkaa Balachandran is a senior sub-editor at ESPNcricinfo