Abid Ali and Shan Masood effectively dealt with the Sri Lankan bowlers in the tricky final hour of proceedings on day two of the second Test to reduce the first-innings deficit to 23 after Shaheen Afridi starred with a tremendous spell of bowling.
The young left-arm quick spearheaded Pakistan's bowling charge, though Sri Lanka managed to gain a more than handy lead courtesy of gritty lower-order contributions.
The match hangs more or less in balance with both teams vying for a series win on a pitch that has thus far looked to considerably assist bowlers.
The day began with the Pakistan pacemen roaring and stamping their authority with nagging lines and lengths.
Sri Lanka resumed their innings at the overnight score of 64-3 with Dinesh Chandimal continuing from where he left off while nightwatchman Lasith Embuldeniya hoped to prolong his stay at the crease and frustrate the Pakistani quicks.
However, Mohammad Abbas soon found the breakthrough as Embuldeniya launched a bizarre slog-sweep off a good-length delivery with the ball taking a deflection off the outside edge only to be caught in the slips.
Angelo Mathews was then prised out by Shaheen via a snorter of a delivery that tailed back in to scratch the inside half of his bat through to the wicketkeeper.
With the experienced Mathews gone, the islanders were evidently struggling at 80 for five as centurion in the first Test, Dhananjaya de Silva, walked out into the middle.
Immediately, Sri Lanka wrestled back the momentum from the hosts with a counterattacking partnership.
De Silva seemed to enjoy sweet timing off the bat, cashing in on the erratic bowling from 16-year-old Naseem Shah while Chandimal grew in confidence to inch towards a half-century, signalling his much-awaited return to form.
The duo's penchant for attacking an off-colour Yasir Shah further compounded the woes for the home side but a timely wicket arrived in the form of a well-directed bouncer from Shaheen.
The throat-high delivery from the 19-year-old was not managed well by de Silva, who departed for a promising 32 from 56 balls.
Niroshan Dickwella's sparkling effort was curtailed shortly thereafter by an absolute beauty from Abbas with the keeper up to the stumps.
The left-handed batsman had thrown Abbas off his line by standing way outside his crease but as soon as Mohammad Rizwan was called up to the wicket, the pacer sneaked through his defences with a ball that swung in by a fair margin.
Meanwhile, Chandimal batted with supreme control during a 143-ball 74 laced with 10 boundaries.
Dilruwan Perera offered him concrete company on the other end as his nervy start was replaced with an assertive array of strokes.
Their vital 51-run stand, which ushered them into the lead, was broken by part-timer Haris Sohail with a wayward delivery that Chandimal cut straight to the man stationed at point.
Pakistan's attempts at dismissing the last two batters quickly were staved off by a valiant knock from Perera, who was perhaps given the freedom by the hosts to build on his innings.
Perera finally got out to Shaheen two runs shy of a fifty and Lahiru Kumara followed him back to the pavilion two balls later.
Contrary to the reserved approach in the initial half of Pakistan's first innings, Shan and Abid unleashed a range of shots to keep the run rate over four per over.