Australia were dismissed for 390 in the last over of the day's play, setting Pakistan a challenging target of 419 to win.
Pakistan, who trail 1-0 in the series after losing the first Test at Rawalpindi by an innings and 99 runs, have never chased such a high target. The highest they have achieved is 315 against Australia at the same ground four years ago when they won by one wicket.
Waugh was in prime form after struggling earlier in the series and his 15th century in his 81st Test was punctuated with nine boundaries and a six off 232 balls in 335 minutes. He was dismissed for 117 when he was beaten in the air by the debutant Shakeel Ahmad for an easy stumping by Moin Khan.
Waugh was involved in three half-century partnerships. He added 56 runs for the fourth wicket with his twin brother Steve, 76 for the fifth wicket with Darren Lehmann and 63 for the seventh wicket with Gavin Robertson.
The latter partnership with Robertson ended Pakistan's faint hopes of levelling the series as he frustrated their bowlers for two hours before being the last man out.
Robertson scored an attractive 45 that included 17 runs in an over of Arshad Khan. He faced 99 balls and hit five fours and a six.
Resuming on 130 for 1 Mark Taylor added four more runs to his overnight score before being bowled by Arshad Khan. That took his series aggregate to 513.
Justin Langer, dropped by Moin Khan when 50, was run out while attempting a risky single with Mark Waugh. Langer, who scored his fourth half century, faced 161 balls and hit three fours and a six. He shared in a 109-run second-wicket partnership with Taylor.
Fourth day; Australia won toss
AUSTRALIA - First innings 280 (M J Slater 96; Shahid Afridi 5-52).
PAKISTAN - First innings 252 (Aamir Sohail 133; G D McGrath 5-66).
AUSTRALIA - Second Innings
(Overnight: 130 for 1)
M A Taylor b Arshad 68
J L Langer run out 51
M E Waugh st Moin b Shakeel 117
S R Waugh c Moin b Shakeel 28
D S Lehmann c Ijaz b Wasim 26
I A Healy c Shahid b Shoaib 3
G R Robertson c Wasim b Shakeel 45
C R Miller c Shahid b Shakeel 0
S C G MacGill run out 10
G D McGrath not out 4
Extras (b4, lb8, nb15) 27
Total (142.3 overs) 390
Fall (cont): 2-135, 3-152, 4-208, 5-284, 6-294, 7-357, 8-357, 9-369.
Bowling: Wasim Akram 22-2-60-1 (nb12); Shoaib Akhtar 17-3-37-1; Arshad Khan 56-14-141-2 (nb1); Shahid Afridi 18-3-49-0 (nb2); Shakeel Ahmad 29.3- 3-91-4.
Umpires: Riazuddin (Pak) and D L Orchard (SA).Reuse content