Federer and Medvedev shared the first eight games together with four consecutive love games but in the ninth game, the Swiss took charge and broke his opponent for the first time.
The 37-year-old faced three immediate break back points but held on to win the set and he broke Medvedev again early in the second set.
As the set progressed, Medvedev’s game became littered with errors and a double fault gave Federer a second break of serve and the 20-time Grand Slam champion served out the match to take his place in the last eight where he will play Kevin Anderson tonight.
Romania’s Simona Halep moved closer to reclaiming the world number one ranking yesterday, advancing into the semi-finals by defeating China’s Wang Qiang 6-4, 7-5.
Following Tuesday’s exit of Petra Kvitova, Halep needs only to reach Saturday’s final at Hard Rock Stadium to knock Japan’s Naomi Osaka from atop the women’s rankings despite her second major title in this year’s Australian Open.
A fantastic recovery from 1-5 down in the second set showed a mental toughness displayed by only the very best.
Halep converted seven of eight break points and hit 24 winners compared to 14 from Wang, whose first serve percentage dipped to 47 per cent.
Wang was aiming for her own slice of history, knowing landing the title would have made her the first Chinese woman in the top 10 since Li Na retired at the end of 2014. She responded strongly in her first Miami quarter-final after falling behind.
The world number 18 was all over the Halep service game, which had showed signs of weakness early on, returning with real aggression to establish a 5-1 lead – a run that saw her win 12 points in a row.
Halep managed to regain composure and broke for 5-2 as Wang started to get nervous. The reigning French Open champion broke again and suddenly had the chance to draw level in the second set.
That chance looked lost as Wang stormed 0-40 up on the Romanian’s serve, but Halep superbly saved all three sets points before a brilliant running forehand winner down the line to equalize 5-5.
Another break gave her the platform to serve for the match, which was sealed when Wang hit long.
Novak Djokovic’s pursuit of a record seventh Miami Open ATP title ended in dramatic fashion early yesterday morning as Roberto Bautista Agut superbly recovered from a first set destruction to win 1-6, 7-5, 6-3 and book a place in the quarter-finals.
And the top seeds kept falling as women’s world number two Petra Kvitova slumped to a surprise 7-6 (8/6), 3-6, 6-2 defeat to Australian Ashleigh Barty.