World number one Djokovic was hampered by a side injury that restricted his movement, although he still recorded a 7-6 (7-1) 6-4 3-6 4-6 6-2 victory.
Djokovic is set to meet 14th seed Milos Raonic in the next round, but said: “I know it’s a tear and I don’t know if I will recover from that in two days. I don’t know if I will step on court.”
The Serb, who is chasing a record-extending ninth men’s singles title in Melbourne and a third in a row, added: “This is one of the most special wins in my life.
“It doesn’t matter who I was up against or at what round, to pull this through is something I will remember for ever.
“In the third and fourth set I just served and couldn’t do much with the returns. I was just putting in two first serves.
“I just tried to stay in there. I was hoping that whatever was happening was going to feel better and towards the end of the fourth it started to feel better.”
Djokovic hobbled between points, clutched his side and received medical treatment, but 23-year-old Fritz, the 27th seed, could not take advantage.
The match was the final one to be played on Rod Laver Arena on day five of the tournament and began with a crowd of up to 8,000 people in attendance at the beginning.
However, the Australian state of Victoria entered lockdown for a third time at midnight on Saturday morning and Tennis Australia warned fans they would need to leave the stadium at 11.30pm, to return to their homes before the lockdown began.
That led to a bizarre scene in the fourth set when, with Frisk 3-2 and a break of serve ahead, the organisers halted the action because the crowd had to leave the stadium, before the match resumed in an empty arena, apart from a handful of coaches allowed in the players’ box.
The Australian Open is still able to be played and organisers are hopeful fans will be able to return from Thursday, 18 February for the final four days of play.
However, for the next five days there will be no fans allowed, in a scene similar to the US Open that was played behind closed doors in New York in August and September.
“With the bad news today, we knew that midnight was going to be the deadline for when we go into lockdown,” Djokovic said. “It was unfortunate for the crowd that we didn’t finish the match with them seeing the end of the match as they were enjoying it.”
Canadian Raonic moved into the fourth round with a 7-6 (7-2) 5-7 6-2 6-2 win over Hungary’s Marton Fucsovics. (Courtesy BBC)