Azhar edged a Peter Siddle delivery towards the third man boundary and, thinking the ball had crossed the rope, halted in the middle of the pitch to talk to fellow batsman Asad Shafiq.
But Mitchell Starc picked up the ball less than a yard from the boundary and threw it back to wicketkeeper Tim Paine, who ran Azhar out, leaving the Pakistani duo -- who boast a combined 130 Tests and over 9,000 runs -- stranded and looking bewildered.
Azhar fell for a well-played 64, including four boundaries as Pakistan took control of the Test setting a massive 538-run target for Australia with two days left.
Australia were 47 for one at close and facing a 1-0 defeat in the two-match series after the first Test ended in a draw.
"My son is going to speak about it (the run out) for a long time and in a funny way," said Azhar of his 10-year-old son Ibtisam, who luckily for him arrived at the ground after his father's dismissal.
"Whenever I will say something about cricket he will surely come back to this incident."
Azhar revealed he was discussing the swing of the ball with Shafiq as they chatted in the middle of the wicket.
"We were just discussing that the ball was swinging a bit late. We both didn't actually realise something like this could happen.
"When Starc threw the ball even then we didn't think anything was happening but when it landed in the gloves of the keeper we realised something funny was happening.
"The way the shot was hit to a fast bowler and the edge flew I thought it reached the boundary. But there is no excuse. Everyone was pulling our legs in the dressing room but at that moment it was a shock."
Azhar admitted he and Shafiq did not watch the ball.
"We were not watching the ball and that was the reason I missed the whole sight of it.
"I wasn't happy with it and thankfully other batsmen did the job and we laughed about it afterwards. It is kind of disappointing and a shock but also funny."
Azhar denied there was any unsporting behaviour from Australian players in his dismissal.
"I don't think it was bad sportsmanship and I take full responsibility as I feel I was a bit ignorant. It was nothing at all as no one got in my way or distracted me.
"It was my own doing. I think the Aussies did the right thing."