NEW YORK (AP) — Novak Djokovic's left shoulder was aching, his chances were fading in the fourth round against Stan Wawrinka and, soon enough, the U.S. Open's defending champion and No. 1 seed was out of the tournament, leaving to a chorus of boos.

Djokovic shook his head as he walked over to the chair umpire to say he was retiring from the match because of that shoulder while trailing 6-4, 7-5, 2-1 and being thoroughly outplayed Sunday night.

"The pain was constant for weeks now," Djokovic said.

Perhaps confused by the sudden turn of events, and likely disappointed in the brevity of the show they got to watch for their expensive tickets, some spectators jeered as Djokovic walked off the court in Arthur Ashe Stadium to head toward the locker room, his two equipment bags over his other shoulder. He responded with a thumbs-up.

"I'm sorry for the crowd. Obviously they came to see a full match, and just wasn't to be," Djokovic said at his news conference. "I mean, a lot of people didn't know what's happening, so you cannot blame them."

The 32-year-old Serb explained that he had been "taking different stuff to kill the pain instantly; sometimes it works, sometimes it doesn't."

'RUSSIA'S DANIIL MEDVEDEV TROLLS BOOING US OPEN CROWD: 'I WON BECAUSE OF YOU'

Djokovic had won 36 of his past 37 Grand Slam matches, and four of the last five major titles, in one of the most dominant stretches the sport has seen. That pushed his Slam trophy total to 16, moving within four of Roger Federer's record 20, and within two of Rafael Nadal's 18.

"Look, it's no secret that I have, of course, desire and a goal to reach the most Slams, and reach Roger's record. But at the same time, it's a long road ahead hopefully for me. I hope I can play for many more years. I'm planning to. I mean, I don't see an end behind the corner at all," said Djokovic, who had been 11-0 in fourth-rounders at Flushing Meadows until this one. "Now it's a matter of keeping my body and mind in shape and trying to still peak at these kind of events that are majors and that are the most significant in our sport."

When it was over, Wawrinka gave Djokovic a hug.

"It's never the way you want to finish the match," said the No. 23-seeded Wawrinka, who will face No. 5 Daniil Medvedev in the quarterfinals. "I feel sorry for Novak."

Djokovic entered the night with a 19-5 head-to-head edge against Wawrinka across their careers. This, though, was their first meeting since the 2016 U.S. Open final, won by Wawrinka.

According to the ATP, this was the 13th mid-match retirement of Djokovic's career, his sixth at a Grand Slam tournament.

This outcome scuttles the much-discussed possibility of a semifinal in New York between Djokovic and Federer, which would have been a rematch of their historic Wimbledon final in July. Djokovic won that one in an unprecedented fifth-set tiebreaker after nearly five hours.

The winner of Wawrinka vs. Medvedev will face the winner of Federer vs. Grigor Dimitrov in the semifinals.

US OPEN 28TH SEED SUAREZ NAVARO FINED $40G AFTER QUITTING

Djokovic began complaining about his left shoulder during a second-round victory on Wednesday, when he repeatedly got massaged by a trainer during changeovers.

He won his next match Friday, looking good and declaring his shoulder much improved, although he refused to disclose any details of the injury or what type of treatment he had received.

While Djokovic is a righty, he uses his left arm for the ball tosses on his serves and to grip the racket for his two-fisted backhands.

His bid for a fourth U.S. Open championship suddenly dissipated Sunday at the conclusion of what for him amounted to a listless and ineffective effort.

Against Wawrinka, a three-time major champion himself, Djokovic never quite had the usual verve on his shots or range on his formidable service returns. He was out of sorts on all manner of shots, accumulating 30 unforced errors and only 12 winners through the first two sets.

"For sure, I could see some little (signs) that he was in trouble," Wawrinka said.

CLICK HERE FOR THE FOX NEWS APP

Djokovic managed to lead 3-0 and 4-1 in the second set, but that was just about all he had in him. Soon he was trying to take shortcuts to avoid lengthy points, and nothing was working.

When that set ended, Djokovic had a trainer on for a massage, but soon thereafter, his title defense was over.

"You just know when you know, I guess," Djokovic said, "when you feel like you're not able to hit (a) shot anymore."