Misbah missed his sixth Test hundred by a mere three runs but a career best 70 not out by Sarfraz Ahmed and a defiant 32 by Bilawal Bhatti kept Pakistan's fight to take them to 330-7 at close on a cloudy day.
When bad light and drizzle ended play 15 overs before schedule, Saeed Ajmal was on seven and Pakistan were leading by 107 runs with a full day's play remaining.
Sarfraz added an invaluable 67 runs for the seventh wicket with Bhatti to frustrate the Sri Lankan bowlers who bowled with discipline and patience on a pitch which had little response for bowlers.
The third and final Test will be played in Sharjah from Thursday.
Also Read
When left-arm spinner Rangana Herath spun one across Misbah's bat to hit the off stump just 20 minutes before tea it looked as if the match would be over soon but Sarfraz and Bhatti kept the fight before Eranga bowled Bhatti in the dying moments.
Sarfraz said he felt more responsibility after Misbah's fall.
Sarfraz improved on his highest Test score of 40 he made against South Africa at Centurion earlier this year by posting his maiden half century. He has so far hit seven boundaries during his 123-ball stay.