Australia on Monday trounced Pakistan to secure a victory of an innings and 48 runs as spin king Nathan Lyon snared five wickets.
At the dinner break in Adelaide, Pakistan were 229 for eight — still needing to score another 58 to make the hosts bat again.
Pakistan resumed day four on a precarious 39 for three with Masood not out 14 and Shafiq on eight after being bowled out for 302 in their first innings and forced to follow on.
It followed Australia’s mammoth 589 for three declared, built around David Warner’s exceptional 335 not out — the 10th highest Test score of all time.
Needing 248 to make Australia bat again and avoid a second successive innings defeat, they made a decent effort to reach the milestone.
Mohammad Rizwan, in only his third Test, was not out 40. Masood made 68 and Shafiq 57.
While Lyon extracted some life out of the pitch, it offered little for Australia’s fast bowlers who were made to toil.
They will be able to take the new pink ball shortly and with the lights coming on, it should offer them more conducive conditions to finish the job.
Masood, who models himself on England’s Alastair Cook, played some glorious strokes, including a six off Lyon, as he assumed a leadership role after Babar Azam and captain Azhar Ali fell cheaply on Sunday evening.
His sixth Test 50, in his 17th Test, arrived with a boundary off Lyon, his sixth four, before he chipped the spinner to mid-off where Mitchell Starc collected an easy catch.
Shafiq, who has 12 Test hundreds to his name, proved to be Masood’s equal and brought up his 25th half-century with a single off Josh Hazlewood.
But Lyon struck again, with Shafiq getting a thin edge to a flighted ball that carried to Warner at slip, before he then removed Iftikhar Ahmed, caught at short leg by Marnus Labuschagne for a battling 27.