Pakistan were just four runs away from victory when their last man standing, Azhar Ali, failed to take the team to the other side and fell lbw.
He scored 65 runs off 136 balls, the highest scorer in Pakistan’s wobbly second innings on the fourth day of play.
They were set 176 to win the match.
Before his dismissal, Asad Shafiq passed a personal milestone of 4,000 Test runs, becoming the 11th Pakistani batsman to do so.
Opener Imam-ul-Haq was trapped leg-before to a full length ball by left-arm spinner Ajaz Patel in the fifth over of the day. Imam made 27 with four boundaries.
His fellow opener Mohammad Hafeez then miscued a drive off leg-spinner Ish Sodhi´s next over and was caught in the covers for 10.
Haris Sohail followed three balls later, caught and bowled off a Sodhi full toss for four.