Sri Lanka 278 and 228 for 5 (Mathews 77*, Tharanga 48) lead Pakistan 215 (Sarfraz 78*, Azhar 52, Pradeep 3-29, Kaushal 3-37, Prasad 3-78) by 291 runs
Scorecard and ball-by-ball details

Angelo Mathews was the rock in Sri Lanka's middle order once again, soaking up all the pressure Pakistan created, and rebuilding from 35 for 3 to take the hosts to a commanding position. Upul Tharanga, Jehan Mubarak and Dinesh Chandimal supported their captain as Sri Lanka gradually stretched their lead to 291 until bad light ended play on another rain-hit day.

It was typical Mathews resistance, blocking and blocking most of whatever Pakistan hurled at him, working the ball into gaps for singles and twos, and exploding into the odd emphatic boundary against the run of play. The few times he was beaten during his 177-ball stay, he shrugged and concentrated harder.

The pitch slowed down as the day progressed, although the legspinner Yasir Shah started turning and bouncing it from the line of off. Although Yasir gave it everything in a 25-over spell of 2 for 70, Sri Lanka dearly needed this effort from their captain to recover from the jolts Rahat Ali and co had delivered.

Sri Lanka had taken two overs to dismiss last man Imran Khan in the morning, making absolutely no attempt to target Sarfraz Ahmed, who was left stranded on 78. But Rahat led a stirring fightback from Pakistan after they had conceded a 63-run first-innings lead.

Ehsan Adil played his part but Rahat was the standout bowler for Pakistan, bowling with sustained pace and control, varying his lengths and extracting bounce and movement off the pitch and in the air.

Consistently taking it away from the left-handers, Rahat straightened two rippers past the defenses of Dimuth Karunaratne and Lahiru Thirimanne, the latter's 11-ball duck ending with a swinging yorker.

Using the short ball sparingly, Rahat created doubts in the minds of the batsmen, and both Karunaratne and Thirimanne were caught half-forward after being beaten numerous times. Thirimanne was also hit on the base of the arm guard as he ducked into a lifter, and had to take treatment on the field.

Adil created similar issues for the right-handed Silva, hitting a tight line and length outside off and moving it away. Silva is a difficult batsman to bowl to, his tendency to play with soft hands ensuring most edges don't carry to the cordon. But the kind of effort Pakistan were putting, and the zip they were generating, even Silva could not avoid nicking one for Misbah-ul-Haq to take a sharp, low catch at first slip.

Rain reprieved Sri Lanka immediately after the third wicket fell, and Tharanga and Mathews batted positively upon resumption in the few overs until lunch.

Mathews survived a review for leg-before off Rahat at the stroke of lunch, but Pakistan did not review when Imran hit Tharanga's pad first ball after the interval. They were probably confused by the two sounds, but one of them was that of Tharanga's bat crashing into his pad. Tharanga was on 29 then, and went on to hit a few more boundaries in a 47-ball 48 before popping one off the inside edge to short leg off Yasir.

Rahat, in such fine rhythm in the first session, was introduced in the second only after Tharanga fell. His second and third spells lacked the threat of the first, and it was Adil who created problems for Mubarak with a hint of reverse, beating the left-hander often outside off.

Mubarak was solid after another shower forced tea to be taken early, and played some superbly-timed drives through extra cover. Mubarak and Mathews doubled the score from 80 for 4 till the former fell in the short-leg trap to Yasir for 35.

Chandimal's arrival quickened the pace of scoring, and he comfortably worked the ball off the back foot as Pakistan started to flag. He progressed to 39 smoothly, and with Mathews inching to 77, Sri Lanka's lead was in touching distance of 300. Only twice has a target more than that been achieved in a Test in Sri Lanka, and a visiting side has never done it.

Abhishek Purohit is a senior sub-editor at ESPNcricinfo