<p class="title">Roger Federer was given a huge scare before finally seeing off Russia's Daniil Medvedev 6-4, 4-6, 6-4 to open his Shanghai Masters defence in unconvincing fashion on Wednesday.</p>.<p class="bodytext">The 37-year-old Swiss top seed faces Spain's unseeded Roberto Bautista Agut on Thursday in the last 16.</p>.<p class="bodytext">The 20-time Grand Slam champion initially wasted little time stamping his mark on the tournament, breaking the 22nd-ranked Medvedev in the first game.</p>.<p class="bodytext">But Medvedev, fresh from winning the Japan Open, broke back and enjoyed even more luck on Federer's service in the second set.</p>.<p class="bodytext">Federer's large cheering squad -- decked out in matching red T-shirts -- looked on in disbelief as Medvedev grabbed the second set.</p>.<p class="bodytext">The 22-year-old then put the Swiss under immediate pressure on his serve in the deciding set, only for an uncharacteristically flustered Federer to hold.</p>.<p class="bodytext">In what was the first meeting between the pair, Federer broke in the ninth game to finally destroy Medvedev's resolve in just under two hours.</p>.<p class="bodytext">With the exception of injured world number one Rafael Nadal, Federer's chief rivals are all still in the mix.</p>.<p class="bodytext">Juan Martin del Potro and Alexander Zverev both defied illness to join Federer and Novak Djokovic in the next round.</p>.<p class="bodytext">Del Potro, the third seed, said that he is suffering from a virus and reviewing his health "hour by hour", after labouring past France's Richard Gasquet.</p>.<p class="bodytext">The Argentine lost Sunday's final of the China Open in Beijing to unseeded Nikoloz Basilashvili and afterwards revealed that he had been unwell.</p>.<p class="bodytext">Three days on and the 30-year-old continues to be under the weather, but just about did enough to see off Gasquet 7-5, 7-6 (9/7).</p>.<p class="bodytext">Between coughs at his post-match press conference, Del Potro said: "It wasn't easy to play for me today, I did what I can. I didn't run too much.</p>.<p class="bodytext">"But I'm going like hour by hour and see how I'm feeling," added Del Potro, who plays 13th seed Borna Coric of Croatia next in Shanghai.</p>.<p class="bodytext">"I got lucky that I won, but tomorrow will be a different day.</p>.<p class="bodytext">"If I have a good night today and I have a good recovery tomorrow morning, maybe I will feel a little bit better for tomorrow night and play better than today."</p>.<p class="bodytext">The 21-year-old Zverev fought off a cold -- he has had a sore throat and blocked nose for a few days -- and the raw power of Basilashvili, winning 7-5, 6-4.</p>.<p class="bodytext">The fourth seed will play Australia's world-ranked 33 Alex de Minaur.</p>.<p class="bodytext">Zverev said that Basilashvili, who is up to a career-high ranking of 23, "knows how to play, definitely".</p>.<p class="bodytext">"Probably the hardest-hitting player I have ever played against," said Zverev.</p>.<p class="bodytext">Number two seed Djokovic nailed his place in the last 16 on Tuesday with a convincing victory over Jeremy Chardy.</p>.<p class="bodytext">The Serb, who is in sparkling form having won Wimbledon and the US Open this summer, plays the 16th seed Marco Cecchinato of Italy on Thursday.</p>
<p class="title">Roger Federer was given a huge scare before finally seeing off Russia's Daniil Medvedev 6-4, 4-6, 6-4 to open his Shanghai Masters defence in unconvincing fashion on Wednesday.</p>.<p class="bodytext">The 37-year-old Swiss top seed faces Spain's unseeded Roberto Bautista Agut on Thursday in the last 16.</p>.<p class="bodytext">The 20-time Grand Slam champion initially wasted little time stamping his mark on the tournament, breaking the 22nd-ranked Medvedev in the first game.</p>.<p class="bodytext">But Medvedev, fresh from winning the Japan Open, broke back and enjoyed even more luck on Federer's service in the second set.</p>.<p class="bodytext">Federer's large cheering squad -- decked out in matching red T-shirts -- looked on in disbelief as Medvedev grabbed the second set.</p>.<p class="bodytext">The 22-year-old then put the Swiss under immediate pressure on his serve in the deciding set, only for an uncharacteristically flustered Federer to hold.</p>.<p class="bodytext">In what was the first meeting between the pair, Federer broke in the ninth game to finally destroy Medvedev's resolve in just under two hours.</p>.<p class="bodytext">With the exception of injured world number one Rafael Nadal, Federer's chief rivals are all still in the mix.</p>.<p class="bodytext">Juan Martin del Potro and Alexander Zverev both defied illness to join Federer and Novak Djokovic in the next round.</p>.<p class="bodytext">Del Potro, the third seed, said that he is suffering from a virus and reviewing his health "hour by hour", after labouring past France's Richard Gasquet.</p>.<p class="bodytext">The Argentine lost Sunday's final of the China Open in Beijing to unseeded Nikoloz Basilashvili and afterwards revealed that he had been unwell.</p>.<p class="bodytext">Three days on and the 30-year-old continues to be under the weather, but just about did enough to see off Gasquet 7-5, 7-6 (9/7).</p>.<p class="bodytext">Between coughs at his post-match press conference, Del Potro said: "It wasn't easy to play for me today, I did what I can. I didn't run too much.</p>.<p class="bodytext">"But I'm going like hour by hour and see how I'm feeling," added Del Potro, who plays 13th seed Borna Coric of Croatia next in Shanghai.</p>.<p class="bodytext">"I got lucky that I won, but tomorrow will be a different day.</p>.<p class="bodytext">"If I have a good night today and I have a good recovery tomorrow morning, maybe I will feel a little bit better for tomorrow night and play better than today."</p>.<p class="bodytext">The 21-year-old Zverev fought off a cold -- he has had a sore throat and blocked nose for a few days -- and the raw power of Basilashvili, winning 7-5, 6-4.</p>.<p class="bodytext">The fourth seed will play Australia's world-ranked 33 Alex de Minaur.</p>.<p class="bodytext">Zverev said that Basilashvili, who is up to a career-high ranking of 23, "knows how to play, definitely".</p>.<p class="bodytext">"Probably the hardest-hitting player I have ever played against," said Zverev.</p>.<p class="bodytext">Number two seed Djokovic nailed his place in the last 16 on Tuesday with a convincing victory over Jeremy Chardy.</p>.<p class="bodytext">The Serb, who is in sparkling form having won Wimbledon and the US Open this summer, plays the 16th seed Marco Cecchinato of Italy on Thursday.</p>