NEW YORK -- Daniil Medvedev established himself as a worthy villain in the eyes of the demanding US Open crowd during a sensational first week at this year's tournament. But in the bright sunshine on Tuesday, he molted right before their eyes into a magician.

The 23-year-old Russian followed his terrific, busy August by becoming the youngest US Open semifinalist in a decade. Coming into the event, many assumed he would be too gassed to make a deep run, but there he is, thanks to his deconstruction of former champion Stan Wawrinka, a trick Medvedev accomplished in 2 hours, 34 minutes, 7-6 (8), 6-3, 3-6, 6-1.

Medvedev triumphed over the three-time Grand Slam champion seemingly by sleight of hand. Despite an obvious injury, he produced remarkable shots like so many rabbits, scarves, watches and coins yanked from a seemingly empty hat. "He was playing really well," Wawrinka said after the match. "He's really solid. He has a tough game to play. I never really find the right rhythm I wanted between staying back and being offensive."

Medvedev had a lot to do with Wawrinka being unable to find a comfort zone, because he has a shape-shifting game and a now-you-see-it, now-you-don't way of keeping opponents from knowing what he's going to do at any given moment.

As his coach, Gilles Cervara, said after the match: "You know, it's like guys don't know how to play [him], because his ball seems easy to play but it's really, really tough. He covers the court so well and his mentality is getting stronger and stronger." After more probing, Cervara cut to the chase: "His game is like his personality. Very different. I said already once, it's like to coach a genius."

Earlier in the tournament, Medvedev showed a genius mostly for the dark arts. He mistreated a ballperson in his third-round win, flashed a middle finger at the jeering crowd, and responded to their catcalls by thanking them, taunting them with the claim that it was their hostility that gave him the energy to get across the finish line despite his fatigue.

He jousted with the crowd during his next match as well, but by the time he finished an odd little victory dance and addressed the crowd, much of the booing seemed halfhearted. Later, he assumed ownership of his earlier actions, telling reporters after that fourth-round win: "Talking about last match, I was an idiot, to be honest. I did some things that I'm not proud of and that I'm working on to be a better person on the court, because I do think I'm a good person out of the court."

Not just a good person, but a compelling player who was greeted for his most recent match politely if not exactly warmly. That would change over the course of the next unpredictable two-plus hours.

The Medvedev Magic Show began with a trick right out of the escape artist's repertoire, the kinesthetic tape on various parts of his lithe 6-foot-6 frame taking the place of chains. At the start of the match it looked as if he would barely be able to move adequately, never mind challenge one of the most feared ball strikers in tennis.

That impression was enhanced when, at 4-3 in the first set, Medvedev summoned the trainer to receive treatment on his left quadriceps muscle. He played gingerly for the next two games, after being massaged and heavily wrapped. He thought that he might not be able to continue for long. When Wawrinka broke back to level at 5-all, it seemed that Medvedev, following Novak Djokovic's lead in the previous round, might present Wawrinka's second consecutive win by retirement.

But Medvedev had the restrictive tape cut away and he went on, Houdini-like, to win the first-set tiebreaker. Gamesmanship? Wawrinka didn't think so.

"I don't care," he said. "I saw him play the last few matches and been saying he has pain, and for sure he has pain. When I saw he was taking timeout, for me was not a problem. I knew he will fight anyway and that he's a tough player to beat."

Medvedev showed a measure of genius in seizing on the antipathy of the crowd in previous matches as emotional fuel. On Tuesday, he found a way to use his compromised condition to tame the power game of Wawrinka.

After his quarterfinal victory over Stan Wawrinka, Daniil Medvedev told the fans, "So many people like my interviews. So many people don't like me. I can just say, 'I try to be myself, guys.''' Matthew Stockman/Getty Images

Medvedev continually changed the pace in rallies. He kept Wawrinka guessing by changing his returning position. He powdered flat serves and chipped backhands. The oldest trick in the tennis book is the drop shot-lob combination, but it's a risky play at the professional level. The ploy worked a number of times for Medvedev, thanks mainly to the way he was able to loft delicate lobs that kissed the distant baselines even when hit from an awkward position. He didn't sound terribly impressed by his own performance.

"The way I won was quite ugly," he said afterward, "because that's what I had to do. I am still really painful in my leg. I knew I have to play without rhythm. Some games I have to not run -- to relax my leg. I was hitting full power, then suddenly I was doing drop shots in the middle. I knew I should not give him any rhythm [because] crucial moments maybe it will make him miss. That's what has worked."

Wawrinka, for one, would have been more than happy to find an equally ugly game. Medvedev proved to be that trick birthday candle that you can blow on forever but never put out. "I wasn't at my best today," the Swiss admitted. "I wasn't moving great. I didn't mix enough my game, and at the end it was a struggle."

Don't be fooled by the mercurial nature of Medvedev's game, or imagine that he's one of those temperamental, creative geniuses who runs hot and cold, with results as unpredictable as his shot selection.

Medvedev hit his stride during the current hard-court season (he's 19-2 with a Masters title and two other finals since Wimbledon). A graduate of the ATP's Next Gen campaign, Medvedev has already developed a degree of consistency that has lifted him into the top five. He leads the tour this year with 49 wins. This was his 10th quarterfinal of 2019. He has yet to lose one.

Medvedev has made peace with the fans, at least on his side of the equation. When a reporter asked if he believes the fans have forgiven him, Medvedev replied: "Hopefully. It's not for me to decide. I got what I deserved. I'm not proud of it. I'm working to be better. Hopefully I can show the bright side of myself."

Wawrinka saw that bright side moments after the match ended, up at the net for the handshake. The two men spoke briefly. "He just said he was sorry, and he really had pain and it was nothing with me," Wawrinka said. "I told him it was no big deal, no problem. He's playing super well and good luck for the future."

The future suddenly looked much rosier for Medvedev when he left the court at Arthur Ashe Stadium. One of the first people he saw informed him that he would have two days off due to the staggered second-week schedule the USTA likes. "That's a huge advantage regarding what happened to my leg," he said. "I don't want to say anything yet, but I think it should be OK."

Medvedev might have to beat Roger Federer and Rafael Nadal back-to-back on Friday and Sunday to win the tournament. He will need all the magic he can muster.