The 31-year-old Serb earned a 6-4, 6-7 (5-7), 6-2, 6-3 victory over the 15th seed in Melbourne, BBC Sport reported.
Djokovic was not at his fluent best, but outlasted Medvedev to win in three hours and 15 minutes.
Russia's Medvedev, 22, grew frustrated as he paid the price for only taking two of nine break points.
Medvedev's resistance continued until the end, saving two match points before Djokovic took the third with a wonderful cross-court winner.
Another triumph for the top seed at Melbourne Park will see him move ahead of Australian great Roy Emerson and Roger Federer, who was knocked out by Greek youngster Stefanos Tsitsipas on Sunday, in terms of all-time victories.
Djokovic's progress to the last 16 had been relatively serene, apart from a third-set blip which came against the run of play in his previous win over Canadian teenager Denis Shapovalov.
But the powerful Medvedev, one of the rising stars and in good form having reached the final at the Brisbane International coming into the tournament, was expected to provide a sterner test.
It was a test of durability as the pair pushed each other in some long, physical rallies – including two which lasted more than 40 shots.
"It was definitely a physical battle," Djokovic said.
"It is difficult to go through him and I had to find another way to go through him.
"In this kind of match you just have to hang in there and wait for your opportunities."
Serena Williams outlined why she is the favorite to win the Australian Open with a 6-1, 4-6, 6-4 win over top seed Simona Halep in a high-quality last-16 match.
The 37-year-old American dismantled Halep's game to race through the opening set in 20 minutes.
Romania's Halep, 27, recovered in the second, breaking in what proved to be the final game.
Williams, seeded 16th, saved three break points for 3-3 in the decider, crucially winning the next game to seize control.
The 23-time Grand Slam champion comfortably held her next service game to edge closer, then served out for victory over last year's runner-up in one hour and 47 minutes.
Triumphantly punching the air with both arms as she gave a steely stare towards her box, Williams showed how much relief she felt at beating the world number one.
"It was an intense match and there were some incredible points, but I love being here," she said.
Williams, searching for her first Grand Slam title since coming back from pregnancy last year, has now won nine of her 10 meetings with Halep.
If Williams goes on to extend her record number of victories in Melbourne, she will equal Australian Margaret Court's all-time tally of 24 Grand Slam titles.
"I really needed to elevate my game," Williams said.
"She's the number one player in the world and there's a reason why. She's a great player."