Roger Federer knew he had things going his way at the Miami Open when he hit three shots off his frame during a wild 17-stroke exchange and still won the point because Filip Krajinovic dumped a half volley into the net.
Federer has won both meetings over Medvedev but the 23-year-old has four titles since the start of last year.
Roger Federer briefly seemed headed for the exit but instead advanced to the third round by rallying past qualifier Radu Albot 4-6, 7-5, 6-3.
Denis Shapovalov took less than 30 minutes to go a set up, but needed a further hour to finish off Andrey Rublev 6-3 7-6 (5), while David Goffin beat 14th seed Marco Cecchinato 6-4 6-4 and Frances Tiafoe got the better of David Ferrer 5-7 6-3 6-3. "I like when players show emotion like Filip did in that instant".
Keeping the pressure on, however, was a different matter as Federer broke straight back before pocketing the opening set. Three-times Miami champion Federer finished with 38 winners but had to overcame 41 unforced errors to defeat Albot, who earned an ovation from the crowd for his efforts.
It was Anderson's first tournament appearance since the Australian Open in January and he said he was happy with the way his elbow felt. Earlier on Saturday, South Africa's Kevin Anderson made a winning return to competition with a 6-4 3-6 6-3 victory over rising Spaniard Jaume Munar.More news: Jennifer Aniston, Reese Witherspoon head to Apple for The Morning Show
More news: PlayStation Could Have Fresh Competition in Stadia, Google's New Game Streaming Platform
More news: Speaker wrecks May's Brexit plan by banning another vote on deal
"I am very relieved and happy to make it through".
"I've played so many matches", the 18-year-old Canadian said.
Up next for Kontaveit in the last eight will be Taiwan's Hsieh Su-wei, who took down former World No.1 Caroline Wozniacki 6-3, 6-7 (0), 6-2 two days after beating the current occupier of that position, Naomi Osaka.
Currently, Federer is leading the ATP Head-to-Head rivalry between him and Medvedev by 2-0.
Elsewhere, 24th seed Grigor Dimitrov eased past Feliciano Lopez 6-1 6-3 and Jordan Thompson secured a comfortable 6-2 6-3 win over 10th seed Karen Khachano.