Novak Djokovic's US Open title defence came to an end after he retired injured while two sets down to Stan Wawrinka.

The crowd on Arthur Ashe were stunned when the world number one approached Wawrinka and embraced him while trailing 6-4 7-5 2-1.

Djokovic has been bothered by a left shoulder injury all week, although it was not apparent during the opening two sets with Wawrinka reprising the sort of form which made him the champion in 2016.

But the Serbian took a medical time-out after dropping the second set, and three games into the third he decided enough was enough.

It means Wawrinka will face fifth seed Daniil Medvedev in the quarter-finals, while the draw has opened up for Roger Federer, who was in imperious form against David Goffin and had been expected to run into Djokovic in the last four.

Earlier, Medvedev revelled in his role as the villain of the tournament after beating Dominik Koepfer to reach the quarter-finals.

The Russian, who caused a stir by sticking his midle finger up at the crowd in a 'visible obscenity' two nights earlier, was jeered as he strode onto court in Louis Armstrong Stadium.

The majority of the spectators were firmly behind German qualifier Koepfer when he went a set and a break up.

But Medvedev eventually won 3-6 6-3 6-2 7-6 (2), before goading the crowd again with his celebration and then saying in his courtside interview: "Guys, continue to give me this energy. You are the best."

Roger Federer

In the afternoon session Federer laid down a marker by dismantling Goffin.

The third seed dropped just four games, winning the last nine on the trot, for a brutal 6-2 6-2 6-0 victory in just an hour and 21 minutes.

Federer had looked susceptible in his opening two matches, dropping a set in both, but is since cruising through the gears.

Goffin, who broke Federer's serve early in the first set, won just seven points in the third, the Swiss finishing him off with a stunning backhand pass down the line.

Federer, looking for a 21st grand slam title, said: "Look, sometimes these scores just happen. You catch a good day, the opponent doesn't, then things happen very quickly.

"Maybe he struggled a bit early on. But I found my groove after a while and was able to roll really, and never looked back.

"David wasn't nearly as good as I expected him to be. He was struggling a little bit. I was able to take advantage of it, and I think that's the key.

"In a fourth round like this, if you can keep it nice, short, simple, you have to take them. I'm very happy."

Federer will face Grigor Dimitrov, the former world number three, in the last eight.

Bulgarian Dimitrov beat Alex De Minaur of Australia in straight sets, 7-5 6-3 6-4.