The right-handed opener was unbeaten on 94 - his second Test fifty - and with him Younis Khan was unbeaten on eight with Pakistan still needing another 59 runs to avoid the follow-on.
Pakistan, trailing 1-0 in the three-match series after losing the second Test in Dubai by nine wickets, lost opener Khurram Manzoor (52) and Azhar Ali (eight) in a dour tussle between the two teams.
The first Test ended in a draw in Abu Dhabi.
Khurram, who scored 73 in the second Test, fell soon after lunch as he tried to glance a leg-side delivery from paceman Shaminda Eranga but only managed to snick it to wicketkeeper Prasanna Jayawardene.
More From This Section
He hit four boundaries during his 125-ball innings.
Ali, dropped for the first two Tests, battled for 27 deliveries and departed after edging off-spinner Dilruwan Perera to slip.
Both batsmen challenged the umpire's decisions but ended up wasting both Pakistan's referrals.