Trailing by two sets, Djokovic shook hands with Wawrinka and conceded the match when he was trailing in the third set and later confirmed he was suffering with a left shoulder injury that meant he simply could not continue.
The injury has bothered him throughout the tournament, particularly in his second-round match against Juan Ignacio Londero.
A strong warm-up told 23rd seed Wawrinka his game was solid and he took advantage of netted Djokovic backhands on both set points he won, some of the 35 unforced errors the Serbian star made.
The crowd booed Djokovic for his decision.
The victor of Wawrinka vs. Medvedev will face the victor of Federer vs. Grigor Dimitrov in the semifinals.
"The more the match was going, better I was playing, I was hitting really hard the ball".
But Djokovic, victor of four of the past five Slam events and 16 overall, remained bullish about his chances of eventually catching and surpassing long-time rival Roger Federer, who holds the men's record of 20 major titles.
But it also greatly enhances Federer's chances to win his first US Open title after a drought of a decade.
"It's no secret that I have a desire and a goal to reach the most Grand Slams and reach Roger's record, but at the same time it's a long road ahead hopefully for me", added the Serb.
With holder Novak Djokovic quitting during his fourth-round match against Stan Wawrinka on Sunday through injury, Federer could potentially face long-time rival Rafa Nadal in the final.
With Wimbledon champion Simona Halep already out in the second round, only top-ranked Naomi Osaka remains among the women who won a Grand Slam tournament this year.
Through his struggles with an elbow problem, Djokovic saw eight slams go by without him lifting any of them, with six shared between Federer and Nadal.
"Obviously I'm in the midst of unfortunate situation, and I have to, you know, suffer the consequences of that. They came to see a full match but it wasn't to be", said the world number one in The Guardian. Many people believe it was a classless move by the crowd to boo an injured player. "And also indoor season, I play historically pretty well in those last couple months of the year". 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.
"For sure I could see some little thing that he was in trouble".