The tourists went to tea struggling at 153-8 in their second innings, a lead of just 71 runs with a minimum of 32.1 overs still to be bowled in the last session of the match.
Sri Lanka will look to wrap up the innings quickly after tea to give themselves enough time to score the required runs for victory in the first match of the two-Test series.
Sarfraz Ahmed was unbeaten on 29 after Abdur Rehman was caught behind off Shaminda Eranga off the penultimate ball before tea.
Pakistan, who trailed by 82 runs on the first innings, lost three wickets in the morning session to take their overnight score from 4-1 to 66-4 by lunch.
Pakistan added eight runs in the morning when seamer Dhammika Prasad had nightwatchman Saeed Ajmal edging a catch to wicket-keeper Niroshan Dickwella.
Opener Ahmed Shehzad made 16 when he was given out leg-before to off-spinner Dilruwan Perera to make it 39-3.
Shehzad, who consulted his partner Azhar Ali before deciding not to ask for an umpire's review, would have survived if he had signalled for it. Television replays showed the ball missing the leg stump.
Herath dealt Pakistan a bigger blow when he bowled first innings century-maker Younis Khan for 13 to reduce the tourists to 55-4.
Ali and skipper Misbahul Haq put on 56 for the fifth wicket on either side of lunch when both fell at the same total to make it 111-6 - just 29 runs ahead with 45 overs left in the game.
Ali (41) was caught behind off Herath and Misbah (28) was leg-before to Perera in the next over.
Pakistan found themselves pinned against the wall at 133-7 when Asad Shafiq, the last recognised batsman, was leg-before to Herath for eight.
The second Test of the two-match series, the last one for retiring former Sri Lankan captain Mahela Jayawardene, will be played at the Sinhalese Sports Club in Colombo from Thursday.
COMMENTS (2)
Comments are moderated and generally will be posted if they are on-topic and not abusive.
For more information, please see our Comments FAQ
Accha? Pakistan cricket team Sri Lanka mein? They played and LOST! Wow! I did not know that. Anyway, I am not surprised because Pakistani cricket team is like the politicians who select them to play...full of disappointments and NO game-plan. Salams
What apathetic display of batting we saw from Pakistan in the second innings. Clearly not designed to handle slightest of pressure!