Novak Djokovic fumes at heckling fan during Australian Open win
The Serb was not at his best and was irritated at times by a raucous late-night crowd at the Rod Laver Arena.
But the world number one fought off four set points in the third set to claim a 6-3, 4-6, 7-6(4), 6-3 victory to stay on course for a record-extending 25th Grand Slam title.
Popyrin's chances quickly evaporated in the fourth set in which Djokovic traded barbs with an unruly fan - commentator Nick Kyrgios saying on Eurosport, for whom he was analysing, that the individual concerned should not have "poked the bear".
Explaining what happened later, Djokovic said: "I mean, you don't want to know (what he said).
"There was a lot of things that were being told to me on the court, particularly from that corner, and the same side the other corner. I was tolerating it for most of the match.
"At one point I had enough, and I asked him whether he wants to come down and tell it to my face. Unfortunately for him, he didn't have the courage to come down.
"That's what I was asking him. If you have courage, if you're such a tough man, tough guy, come down and tell it to my face, and let's have a discussion about it."
Heckling aside, Djokovic also had trouble with his game. His forehand was unusually fragile and at times he seemed bothered by the wrist problem that flared up prior to the tournament.
He also looked flat at times as he dealt with a cold but still managed to get the job done against Popyrin who will rue not taking the third set.
Next up for Djokovic is Argentine Tomas Etcheverry who has already accounted for Andy Murray and Gael Monfils.
After a tumultuous night at the Rod Laver Arena, Djokovic said he may prepare for that by visiting Melbourne's Botanical Gardens - and spending some time with his favourite tree.
"There's one particular tree that I've been having special relationship with, so to say, in the last 15 years," he said. "I love every corner of botanical gardens. I think it's (an) incredible treasure for Melbourne.
"That particular tree, I cannot reveal which one, I'll try to keep it discreet for myself when I'm there to have my own time. I like to ground myself and connect with that old friend."