Younis scored an unbeaten 103 to go with his first-innings 106. Pakistan, which had a 151-run innings lead, declared its second innings at 286-2 after tea.
Shehzad and Younis blasted the Australian bowlers on a slow surface with a 168-run second wicket stand after Pakistan resumed overnight on 38-0.
Shehzad hit 10 fours and four sixes in his nearly five-hour knock before he fell lbw while attempting to reverse sweep Steve O'Keefe (2-112).
Captain Misbah-ul-Haq declared when Younis became Pakistan's leading test centurymaker, with 26 hundreds, by sweeping O'Keefe to the midwicket boundary.