Djokovic managed to stay in contention after an extraordinary five-hour, five-set win to reach the quarter-finals.
The Serbian world number one had to dig deep to see off 15th-seeded Wawrinka's brave challenge before prevailing 1-6, 7-5, 6-4, 6-7 (5/7), 12-10
in a draining five hour, two minute match that finished at 1.41am local time.
Djokovic somehow has to regroup for his quarter-final on Tuesday against Czech fifth seed Tomas Berdych.
Wawrinka, the Swiss Davis Cup partner of Roger Federer, produced arguably his finest match to take the three-time Australian Open champion Djokovic to
the brink in a desperately-fought 104-minute final set.
"All the credit to him," Djokovic said.
"I feel sorry that one of us had to lose," hesaid.
"He definitely deserved to win.
"But I'm just thrilled to be able to fight once again up to the last moment."
Wawrinka had lost his previous 10 encounters with Djokovic going back to 2006, but he produced 69 winners and seven service breaks to have the Serb in deep trouble at times during the epic match.
Meanwhile, Federer earlier put big-talking Australian Bernard Tomic firmly in his place Saturday as he joined Andy Murray and Serena Williams in the second week of the Australian Open.
The revered 17-time Grand Slam-winner, afforded a bigger cheer than Tomic as he entered Rod Laver Arena, held court as he swept to a straight-sets win, after coming through a tight second-set tie-break, 6-4, 7-6 (7/5), 6-1.
After Tomic had talked up his chances of an upset, Federer's motivation was clear as he broke immediately and took the first set, clawed his way back from
4-1 down in the second-set tie-break and then sped through the third.
Federer, who became the first man to collect 250 Grand Slam wins, will now face Canada's Milos Raonic in the fourth round as he continues his bid for a
fifth Australian Open crown.
"Overall we both played a great match," Federer said.
"Bernard has had a great run and he really got the best out of me tonight, so I hope he can keep it up, I really wish him the best," he said.
"You've got to expect the unexpected and Bernard's got the tools to do that," Federer said.
"The court was playing a touch faster when we played last year so it allows him to play a bit more aggressive and he's a big guy with a powerful serve."
Earlier, Williams and defending champion Victoria Azarenka came through their first uncomfortable moments, and Murray was also tested before reaching the last 16 at Melbourne Park.