Updated
Babar Azam just missed a maiden Test century but Pakistan gave itself more than two days to win the short Test series against Australia.
Azam fell for a career-best 99 and captain Sarfraz Ahmed added 81 before he declared their second innings over at 9-400 for an overall lead of 537 runs.
Pakistan delayed the declaration, mindful of Australia escaping defeat in the first Test in Dubai last week.
Pakistan declared there also, and gave itself just under five sessions to bowl out Australia.
But Australia, given an improbable 462 to win, held out with two wickets to spare.
This time, Pakistan has set Australia a monstrous 538 to win in more than six sessions, and already undermined that notion by dismissing Shaun Marsh for 4 with an incredible delivery by debutant Mir Hamza.
Australia was 1 for 47 at stumps on day three with Aaron Finch on 24 and and Travis Head on 17.
Marsh was forced to open the innings after regular opener Usman Khawaja injured his troublesome left knee during a warm-up before the third day's play.
Marsh has struggled in the series, which has ended for him with scores of 7, 0, 3 and 4.
The lefthander couldn't cope against the Pakistan seamers, and gave Hamza his first Test wicket when he lost his off stump.
He didn't field all day and had to drop down the order.
Pakistan suffered a late collapse but its lead had already passed 500.
It resumed from 2 for 144 overnight and the morning session was lowlighted by Azhar Ali's embarrassing run-out on 64.
But the ball stopped before the boundary at third man, and the chasing Mitchell Starc threw it at the striker's end and captain Tim Paine whipped the bails off.
Ali, playing his 67th Test, and Shafiq, playing his 63rd, were dumbfounded while the Australians celebrated a little slice of luck.
That dropped Pakistan to 4-160, but Shafiq, and particularly Azam and Ahmed took advantage of a tiring Australia attack.
Shafiq was the only wicket to fall in the middle session, caught at point for 44.
Then Azam and Ahmed dominated, briskly scoring 133 runs for the sixth wicket. Australia couldn't break the partnership even with the second new ball.
Azam was on 99 when he fell lbw to seamer Mitchell Marsh while trying to play across the line. Azam's disappointment was obvious. His 161-ball knock included six fours and three sixes.
Offspinner Nathan Lyon, burdened with much of the workload, then grabbed two wickets in one over, those of Bilal Asif (15) and Yasir Shah (4).
Legspinner Marnus Labuschagne got Ahmed when the captain missed a sweep and was trapped lbw. Ahmed faced 123 balls and hit five fours and a six.
Lyon finished with 4-135 from 43 overs, and eight wickets in the match.
AP
Topics: sport, cricket, united-arab-emirates, australia, pakistan
First posted