Stumps Sri Lanka 378 and 176 for 5 (Mathews 35, de Silva 30*, Naseem 2-29) lead Pakistan 231 (Salman 62, Ramesh 5-47, Jayasuriya 3-80) by 323 runs
Pakistan removed Sri Lanka's top five in a little over a session, but had given up so much ground in the first innings that they remain in a desperate situation. They are 323 runs back at the end of day three, with five Sri Lanka wickets still remaining.
On a day curtailed by bad light, the hosts took the visitors' last four wickets for 40 runs, obtaining a 147-run first innings lead thanks to Ramesh Mendis' five-wicket haul. Pakistan's bowlers then did their best to keep Sri Lanka in check by having the hosts 117 for 5 in the second innings, before a 59-run unbeaten stand between Dhananjaya de Silva and Dimuth Karunaratne re-established Sri Lanka's dominance.
Karunaratne was clearly struggling with a lower-back injury that had kept him off the field for much of Pakistan's first innings and prevented him from coming in any earlier than at No. 6, where he was unbeaten - with de Silva at the other end - before the teams went off for bad light.
Pakistan had begun the day well, though perhaps unambitiously. Yasir Shah and Hasan Ali batted out almost 14 overs, but struck only one boundary when Hasan came down the track to launch Prabath Jayasuriya over midwicket, and made just 30 runs together for the eighth wicket.
Sri Lanka's spinners had occasionally threatened with the old ball, but when they took the new one - just before the first hour of play was up - they were consistently menacing.
Jayasuriya broke the stand, as Hasan could only get an under-edge on to the stumps as he tried to sweep. Soon after, Nauman Ali had his outside edge taken by a big-turning Ramesh delivery, before Yasir was trapped in front by the same bowler to wrap the innings up for 231. Ramesh got 5 for 47 - his third five-wicket haul in Tests - while Jayasuriya took 3 for 80.
As Karunaratne could no earlier than 2.20pm local time since he had been off the field too long, Niroshan Dickwella opened the innings for Sri Lanka, but without substantial success. He survived the five overs he and fellow opener Oshada Fernando faced before lunch, but was out in the first over of the afternoon, nicking a Naseem Shah ball that was angled across him on 15.
Three other Pakistan bowlers took the three remaining wickets to fall in that session. Yasir had Oshada lbw less than five overs after Dickwella's dismissal. Mohammad Nawaz got Kusal Mendis lbw trying to sweep very soon after that.
Then came perhaps the most controversial decision of the day. Angelo Mathews, playing his 100th Test, was given not out edging a ball that ricocheted off the keeper's gloves to slip. But the bowler Agha Salman was intent on reviewing that decision, and third umpire Marais Erasmus ruled Mathews out, despite Snicko having showed only the merest tremor. Mathews left the field shaking his head, having made 35.
After tea, Naseem struck again. Dinesh Chandimal attempted a booming drive to a full, wide delivery, and ended up only edging it behind for 27 - his lowest score in his last three Tests.
De Silva then made his presence felt with some early boundaries, and set about establishing a partnership with Karunaratne, who was clearly hampered in both his batting and his running between the wickets, by his back injury.
De Silva was especially effective on the back foot - as he often is - pulling Naseem in front of square for four, while also cutting Yasir for three boundaries behind point. Karunaratne hit two boundaries in his 51-ball stay - a reverse sweep off Yasir, and a conventional sweep off Nawaz. He went to stumps on 27; de Silva on 30.