Leeds:Chasing a total of 180 runs in the second innings, Pakistan were 40 runs away from their series-leveling win at Headingly when the stumps were drawn on Day 3 of the second Test.
Pakistan were 140/3 at the close. Imran Farhat scored 67 runs while Azhar Ali was unbeaten on 47 runs.
Australia were bowled out for 349 in their second innings, having made just 88 in their first.
Leg-spinner Smith, in only his second match at this level, was last man out for 77, bowled slogging at Umar Gul, after coming in when Australia's advantage was only 47.
But he batted well against the new ball, taking advantage of any loose deliveries, in a 100 ball innings featuring two sixes and nine fours.
He shared stands of 37 with both Mitchell Johnson and Ben Hilfenhaus for the eighth and ninth wickets respectively
They were partnerships to fray Pakistan's nerves.
They have lost their last 13 Tests against Australia - a record run for one country against another - and in Sydney in January were bowled out for 139 chasing a fourth innings victory target of 176.
Smith went to fifty in style, sweeping leg-spinner Danish Kaneria for four.
And he followed up by launching Kaneria for two sixes in as many balls, the second a huge hit onto the roof of the Football Stand End.
In the morning, Pakistan teenage left-arm quick Mohammad Aamer took three wickets for just 12 runs in 16 balls, on his way to final figures of four for 86 in 27 overs, to leave Australia 215 for five at lunch.
Michael Clarke, the last of Australia's recognised batsmen, was 76 not out, having started the day unbeaten on 32 and wicketkeeper Tim Paine, who top scored with 17 in the first innings, was 17 not out.
However Clarke added just one to his interval score when, to Mohammad Asif's first ball after lunch he was caught behind off a superb full length delivery that just seamed away enough to take the outside edge and end the Australia vice-captain's four hours' of resistance.
Australia were plunged into further trouble by a fortunate Kaneria wicket.
Paine in what was only his second Test, made a composed 33 in two hours with five boundaries. But his innings ended when he spooned a Kaneria long hop to Azhar Ali at cover.
Smith and Mitchell Johnson added valuable runs and with Australia 264 for seven after 80 overs, Pakistan took the new ball as soon as it was available.
But when Asif, unusually, dropped short, Smith pulled him for four to take Australia's lead past a hundred.
But in the fifth over of the new ball, Johnson was lbw to Asif for 12.
However, new batsman Hilfenhaus cover-drove Asif for four before Smith lofted the seamer over mid-off for another boundary.
Kaneria succeeded where the quicks failed, Hilfenhaus edging him to Umar Akmal at slip after making 17 featuring four boundaries.
Aamer took three for 20 as Australia were routed for 88 on Wednesday - their lowest Test total since being dismissed for 76 by the West Indies at Perth in 1984.
Australia resumed on their overnight score of 136 for two, 34 behind Pakistan's first innings 258.
Ricky Ponting, the Australia captain, was 61 not out, having become in the course of his innings only the second batsman, after India's Sachin Tendulkar, to score 12,000 Test runs.
But Ponting had added only five more when he drove loosely outside off stump against Aamer and was caught by wicketkeeper Kamran Akmal for 66, having put on 89 for the third wicket with Clarke.
(With agency inputs)