Pakistan is 40 runs away from ending its 15-year wait for a Test victory against Australia after closing the third day at Headingley on 140-3.
In Salman Butt's first match as captain, Pakistan confidently set about chasing down a potentially tricky victory target of 180 thanks to a nerveless 110-run stand between Imran Farhat and Azhar Ali for the second wicket.
And while Farhat fell just before the close for 67 and Umar Amin followed for a duck, Pakistan was still on course to inflict a first defeat on Australia since it lost the Ashes decider at The Oval last August.
Australia had earlier been bowled out for 349, compiled thanks mainly to Michael Clarke and 21-year-old all-rounder Steve Smith who both hit 77, to set up a teasing chase.
The target was four more than Pakistan failed to run down when it suffered a humiliating defeat in Sydney earlier this year, after Australia had been bowled out for 127 batting first.
The similarities between that match and this had the potential to unnerve a young Pakistan side after Australia recovered from being bowled out for 88 - its lowest total in 26 years - on the opening morning.
But Farhat, who was dropped on four, and Azhar steadied the nerves and blunted an Australian attack as they rattled along at more than four runs an over to guide their team within sight of a rare success.
Doug Bollinger bowled Azhar late in the day before having Amin caught behind, but otherwise the Australian front-line bowlers again looked short of ideas.
The Australians may have fancied their chances when Salman was caught by Clarke off Ben Hilfenhaus with the score on 27, but they never managed to assert any pressure thereafter.
Australia had given itself a chance of victory after their tail again wagged, led by a blazing maiden Test half-century by Smith, as their last five wickets added 185.
The 21-year-old all-rounder's enterprising innings of 77 from 100 balls gave Australia a hope of an unlikely win after teenage seamer Mohammad Aamer was again the pick of the Pakistan attack with figures of four for 86, including three crucial wickets in the first hour this morning.
Australia had started the day 34 runs behind with skipper Ricky Ponting and Michael Clarke at the crease but Aamer removed three batsmen before they got into the black.
The 18-year-old claimed the crucial wicket of Ponting in the third over the day when the skipper flashed at a wide delivery to offer a simple catch to wicketkeeper Kamran Akmal for 66.
Mike Hussey then quickly followed for eight when Umar Akmal held on diving forward at second slip before Aamer, who was bowling from the Football Stand End for the first time in the innings, continued Marcus North's poor series with the bat when he chopped on for a duck after defending too far away from his body.
It meant North has managed just 36 runs at an average of nine in the series.
With wickets falling around him Clarke stood firm with a piercing cover drive off Aamer before he brought up his half-century, from 99 balls, with a nudge for two to square leg.
His stand with Paine, who had driven impressively on a couple of occasions, had added 53 before Clarke was out from Asif's first ball after lunch.
The right-hander lunged at a full-length delivery