Roger Federer advanced to the last eight ©Getty Images

Heavyweights Roger Federer and Novak Djokovic are both through to the Association of Tennis Professionals (ATP) Shanghai Masters quarter-finals after winning today at the Qizhong Forest Sports City Arena in China.

Swiss world number two Federer beat Spain's Roberto Bautista Agut in three sets to advance to the next round of the ATP World Tour Masters 1000 competition.

The match lasted an hour and 51 minutes and saw Federer lose the second set.

But the 20-time Grand Slam champion still won 6-3, 2-6, 6-4 to set up a quarter-final contest between the top seed and eighth seed, Kei Nishikori.

The Japanese player booked his place in the match up after beating American Sam Querrey in straight sets.

Nishikori took the first set by winning a tie break before putting on a more dominant display in the second.

Querrey did not convert his one and only break point which handed the match, 7-6, 6-4, to Nishikori.

Nishikori has only won two of seven encounters with Federer, with his last victory at the ATP World Tour Masters 1000 competition in Miami in 2014.

The biggest casualty of the day was Juan Martin del Potro, who had to retire after the first set of his match against Borna Coric.

The third seed slipped in the 10th game and landed on his right kneecap.

He received a medical time-out with the scores at 5-5 in the first set but, despite heavy strapping, the Argentine never recovered full movement.

His Croatian opponent served out the set, 7-5, and Del Potro walked to the net to retire.

Del Potro has already qualified for the World Tour Finals next month due to his second place finish at the China Open.

Coric makes his third World Tour 1000 Masters quarter-final and will have to face Australia's Matthew Ebden next.

The two have never played each other but Coric boasts a much higher world ranking.

Coric is 19th in the world to Ebden's world ranking of 51.

Ebden eased past Germany's Peter Gojowczyk in 50 minutes, 6-2, 6-3, to secure his quarter-final place.

Eleventh seed Kyle Edmund will play fourth seed Alexander Zverev next as they both overcome their unseeded opponents.

Britain's Edmund won the first set tie break to set up a straight set victory over Chile's Nicolas Jarry.

After an hour and a half on court, Edmund prevailed 7-6, 6-3.

He is joined in the last eight by Zverev with the German dominating Australia's Alex de Minaur, 6-1, 6-4.

Finally, Djokovic only needed an hour and nine minutes to dispatch Italy's Marco Cecchinato in straight sets.

With 81 per cent of first serves in, Djokovic eased to victory, 6-4, 6-0, to set up a quarter-final against South Africa's Kevin Anderson.

The Serbian second seed, a 14-time Grand Slam champion, has not lost to Anderson since 2008.

The South African progressed to the next round with a less dominant straight sets performance, as the tenth seed, Stefanos Tsitsipas of Greece, forced a tie break in the second.

Seventh seed Anderson won 6-4, 7-6.