Top-ranked defending champion Novak Djokovic retired with a shoulder injury after dropping the first two sets of Sunday’s US Open last-16 match against Stan Wawrinka.

Swiss 23rd seed and 2016 champion Wawrinka led Djokovic 6-4, 7-5, 2-1 when the Serb quit, having received treatment on his troublesome left shoulder before the start of the third set.

“It’s never the way you want to finish a match. I’m sorry for Novak. He’s an amazing champion,” Wawrinka said.

Djokovic, who has won four of the past five Grand Slam events and 16 overall, had struggled with a painful left shoulder during his second-round win over Juan Ignacio Londero.

He said he felt “almost pain-free” following a straight-sets defeat of Denis Kudla in round three, but the problem resurfaced against Wawrinka in the first meeting between the pair since the final here three years ago.

“I want to keep my level of tonight. I think I was playing super good tennis. I’m happy to be back,” said Wawrinka, who will meet fifth seed Daniil Medvedev in the quarter-finals.

The Russian fifth seed booked a berth in the last eight by defeating 118th-ranked German qualifier Dominik Koepfer 3-6, 6-3, 6-2, 7-6 (7/2) at Louis Armstrong Stadium.

Earlier, Roger Federer advanced to the US Open quarter-finals for the 13th time in his past 15 attempts Sunday by defeating Belgian 15th seed David Goffin 6-2, 6-2, 6-0.

The 38-year-old Swiss third seed, trying to stretch his men’s Grand Slam record title total to 21, took only 79 minutes to book a quarter-final berth. He will face Bulgarian Grigor Dimitrov who defeated Australia’s Alex de Minaur in straight sets.

“It was great. I thought I had a good feeling out here,” Federer said. “David didn’t have his best day either, he was struggling.”

Federer’s victory kept him on a semi-final collision course with top-seeded defending champion Novak Djokovic, who plays the night feature match at Arthur Ashe Stadium against three-time Grand Slam winner Stan Wawrinka, the Swiss 23rd seed.

Federer, who improved to 9-1 in his career rivalry with Goffin, is 7-0 lifetime against 78th-ranked Dimitrov.

Five-time US Open champion Federer’s Open Era Slam quarter-finals record grew to 56 and he matched Andre Agassi’s second-best US Open total of 13 quarter-finals – second only to 17 by Jimmy Connors – in a dominant performance at Arthur Ashe Stadium.

Goffin broke in the third game of the match and Federer responded by winning the next five games to seize the opening set in 26 minutes, 11 of the next 13 to grab command of the affair inside of an hour, and 17 of the final 19 in stunningly rapid fashion.

“I was down in the score earlier,” Federer said. “Obviously you have to come back. I was too down on myself.

“In a way I feel bad about beating up on a friend like David. I hope he has a better end of the year.”

Men’s singles fourth round:

Stan Wawrinka (SUI x23) bt Novak Djokovic (SRB x1) 6-4, 7-5, 2-1, retired

Daniil Medvedev (RUS x5) bt Dominik Koepfer (GER) 3-6, 6-3, 6-2, 7-6 (7/2)

Roger Federer (SUI x3) bt David Goffin (BEL x15) 6-2, 6-2, 6-0

Grigor Dimitrov (BUL) bt Alex De Minaur (AUS) 7-5, 6-3, 6-4

With AFP inputs