The usually composed left-hander, within striking distance of his 11th Test hundred, in his country of birth no less, was on 97 when he attempted to play a reverse sweep to a Nauman Ali delivery during the second session of day three.
Khawaja failed to even get an edge to the left-arm orthodox spinner's ball, as it collected his right glove and ballooned up to Imam-ul-Haq at short leg.
AS IT HAPPENED: Pakistan vs Australia, First Test, day three
Umpire Aleem Dar rejected Pakistan's appeal, but captain Babar Azam reviewed the decision and it was overturned.
When poor light led to stumps for a second day in a row, Australia were 2-271 in reply to Pakistan's first-innings total of 4-476 declared.
Marnus Labuschagne reached stumps on 69 and Steve Smith 24, after David Warner was bowled by Khan on 68 during the second session.
Khawaja's squad selection for the tour of Pakistan, Australia's first since 1998, had captured the hearts of the cricket world, and if the Islamabad-born batter had followed it up with a ton it would have made for an even more special moment.
"Well, why, oh why, oh why did he play that shot on 97?" said former England Test batter Rob Key on Fox Cricket.
"I have got no idea what he was thinking."
Pakistan had gifted Khawaja a life on 22, when a thick edge flew to Fawad Alam in the gully and the ball was grassed.
But the reprieve on 22 and Khawaja's perplexing shot selection on 97 should take only minimal gloss off what was a sublime knock.
The 35-year-old drove, hooked, swept and ramped with exquisite touch, and registered 15 fours on the way.
For a daily dose of the best of the breaking news and exclusive content from Wide World of Sports, subscribe to our newsletter by clicking here!