He did so after fourth-ranked Medvedev tamed self-styled "wild horse" Fabio Fognini 6-3, 7-6 (7/4) to canter into the semi-finals.
A single break was enough for Djokovic to serve out the first set, but the 32-year-old Serb's performance wavered in the second.
Djokovic, the defending champion, will next play Greek sixth seed Stefanos Tsitsipas who beat Poland's Hubert Hurkacz 7-5 3-6 7-6 (5) in the only three-setter of the day.
"I was a bit fortunate to win that first set but I played okay and I fought extremely hard".
Towards the end of the match, Djokovic was serving incredibly well - winning his last two service games to love.
The market suggests, and my model agrees, that it's going to take more than this to beat Djokovic tomorrow, and Novak is likely going to have a real off-day if Tsitsipas is to cause a shock result.
The world No.7 remained persistent and patient in lengthy exchanges to find the match-winning opportunity in the third set.
"The first set was certainly crucial to put me in the lead".
China lowers expectations for United States trade talks
That would extend to import taxes to virtually everything China ships to the United States. Both sides were due to dine together on Thursday evening.
We'll all leave pitch if racially abused, says England striker
" Harry Kane even said that if we're not happy, if a player is not happy, we all come off the pitch together". Don't isolate one person, we're a whole team.
"You're Hurting Me!": Extinction Rebellion Protester Dragged From City Airport By Police
But one flight to Dublin was delayed when an activist staged an on-board protest as the plane was due to take off. Police said they had made "a number" of arrests.
Tsitsipas also earned a place at the year-end ATP Finals for the first time on Friday.
Medvedev - another of the next generation - sent down 12 aces to help see off Fognini and said: "I don't know what happened, my serve was crushing it".
Italy's Matteo Berrettini faces Dominic Thiem after beating Spain's Roberto Bautista Agut 7-6 (5) 6-4.
Federer committed 40 unforced errors but saved five set points in the opening set.
"I never really felt like I had the upper hand over David today", Federer said.
The Swiss second seed will be up against German fifth seed Alexander Zverev, who dispatched Andrey Rublev 6-0 7-6 (4) in 84 minutes.
I thought he took really a lot of good decisions, and he was super fast on his feet today, which I think made it really hard for me to get my freebies and winners off the baseline, because he was getting to all of them.