Riaz grabbed 3-10 to derail Sri Lanka's second innings — 34-5 at close — but the visitors were still in a strong position with an overall lead of 254 runs with five wickets intact.
Riaz dismissed Sri Lankan skipper Dinesh Chandimal leg before for nought in the last over before close to give Pakistan a faint hope of upsetting the tables, but it will be an uphill task for their faltering batsmen to improve in the second innings.
Cricket triumphs as Pakistan vanquish the World
Pakistan were dismissed for 262 in their first innings, conceding a big 220-run lead following Sri Lanka's first innings 482.
It was paceman Mohammad Abbas who started the slide, having opener Kaushal Silva caught behind for three before Riaz dismissed first innings centurion Dimuth Karunaratne for seven.
India drubbing boosted our morale, claims Sri Lanka coach
He then had debutant Sadeera Samarawickrama out for 13 in a hostile spell of 3.3 overs. Leg-spinner Yasir Shah had nightwatchman Suranga Lakmal out for one as Pakistan started to stage a fightback.
At close Kusal Mendis was unbeaten on eight.
Sri Lankan spinners Dilruwan Perera (3-72) and Rangana Herath (3-84) had bundled Pakistan out just after dinner to put Sri Lanka in sight of a series win.
COMMENTS
Comments are moderated and generally will be posted if they are on-topic and not abusive.
For more information, please see our Comments FAQ