Pakistan stretched their lead to 281 runs at the end of day 2 in Abu Dhabi with eight wickets still in hand.
Fakhar Zaman and Sarfraz Ahmed guides Pakistan reclaim advantage after Lyon wreaks havoc.
The visitors hung on by two wickets to draw the Dubai Test, as Pakistan applied immense pressure in the final hour.
Pakistani spinner announced his retirement from international cricket. He played a total of 22 Tests, 31 ODIs and 8 T20Is between 2006 and 2014.
Khawaja reached his second half-century of the Test by stumps, but Pakistan remained in firm control after the fourth day.
Pakistan lose three, extend lead to 325 after visitors collapsed from 142/0 to 202 all out as Bilal picked up six wickets on debut.