Roger Federer is safely through to round three of the Shanghai Masters ©Getty Images

Roger Federer avenged a rare early-round blemish on his Shanghai Masters record as he breezed past Spain's Albert Ramos-Viñolas in straight sets today.

Ramos-Viñolas upset the Swiss legend in the second round of the event in 2015, ending a 0-15 record against top-10 players to stun the defending champion in three sets.

But there was to be no repeat, with Federer easing to a 6-2, 7-6 win to reach the last 16 of the season's penultimate Association of Tennis Professionals (ATP) Masters 1000 tournament at the Qizhong Forest Sports City Arena.

The 20-time grand slam champion broke twice in the opening set and sailed through his service games in a match lasting one hour and 26 minutes.

He never faced a break point and was pushed to deuce only once, in the fourth game of the second set.

Ramos-Viñolas fought hard in the second set, but two-time champion Federer came back from 1-4 down in the tie-break to advance.

"I was hitting my spots and really was never in trouble there," Federer said.

"But, of course, all of a sudden, being in a breaker calls out for different play sometimes and different momentum. 

"He had his chances, but it was a nice comeback for me and overall I was very happy."

Russia's Daniil Medvedev made an impressive start to his bid for success ©Getty Images
Russia's Daniil Medvedev made an impressive start to his bid for success ©Getty Images

The 38-year-old, going for his 29th ATP Masters 1000 crown, will next meet Belgian David Goffin or Kazakhstan's Mikhail Kukushkin for a place in the quarter-finals.

The 13th-seeded Goffin beat France's Richard Gasquet 6-2, 6-3, while Kukushkin knocked out Serbia's Miomir Kecmanović.

Among today's other winners was third-seeded Russian Daniil Medvedev, who defeated Great Britain's Cameron Norrie 6-3, 6-1.

Tenth-seeded Italian Fabio Fognini is also through to round three after downing Great Britain's Andy Murray in a three-set encounter.

Three-time champion Murray, who returned to singles action in August at the Western and Southern Open in Cincinnati following a long-term hip injury, twice served for the match at 5-4 and 6-5 in the deciding set.

But Fognini dug deep to record a 7-6, 2-6, 7-6 victory over three hours and nine minutes.

Elsewhere, there were surprise losses for ninth-seeded Frenchman Gael Monfils and 12th-seeded Croatian Borna Ćorić.

Monfils was beaten 2-6, 6-7 by Poland's Hubert Hurkacz, while Ćorić fell to a 4-6, 6-7 defeat at the hands of Russia's Andrey Rublev.

Action in Shanghai continues tomorrow.