Nick Kyrgios ended Daniil Medvedev's defence of the US Open title as he earned a thrilling four-set win on an entertaining night in New York.
The 27-year-old Australian demonstrated all of his shot-making - and propensity for creating drama - in a 7-6 (13-11) 3-6 6-3 6-2 win in the last 16.
Medvedev, 26, will lose his ranking as world number one after the defeat.
Wimbledon runner-up Kyrgios goes on to play another Russian, 27th seed Karen Khachanov, in the quarter-finals.
Khachanov reached his third Grand Slam quarter-final by outlasting Spanish 12th seed Pablo Carreno Busta in a 4-6 6-3 6-1 4-6 6-3 win.
"It was an amazing match. Daniil is the defending champion and a lot of pressure on his shoulders, but I've been playing great recently," said 23rd seed Kyrgios, who will move back into the world's top 20 after the win.
"People were really starting to doubt my ability to pull out matches like this at majors. I'm really proud of myself because it hasn't been easy dealing with all the criticism."
Kyrgios has regularly demonstrated over the years he has the talent to win one of the major tournaments, but said he had been in some "really scary places mentally" which had stopped his progress.
Reaching the Wimbledon final, where he lost to Novak Djokovic, showed he had figured out what he needed to do on and off court to be successful.
His form has been transferred to the North American hard courts - winning the Washington title and now going further at Flushing Meadows than before.
"I just feel like I'm playing for a lot more than myself. I've got a lot of motivation in the back of my mind," said Kyrgios.
"I've been away from home now for four months. My whole team has. We don't get to see our family like other tennis players do the majority of time.
"I'm trying to make it worthwhile, trying to make it a memorable ride for all of us. Hopefully we can get it done, go back home and really celebrate."
Kyrgios and Medvedev deliver the show which they promised
Apart from Serena Williams' farewell, this was the biggest blockbuster of the tournament so far and a match-up between two characters which would have befitted the latter stages.
The pair have been two of the standout players on the ATP Tour in recent months, with Kyrgios winning the most tour matches since the start of June after 25 victories and Medvedev next behind him - and alongside Britain's Cameron Norrie - on 18.
Both players promised beforehand to "put on a show" on the Sunday night of a holiday weekend in New York.
They did not disappoint.
Almost three hours of ferocious serving, baseline blows, momentum swings and bizarre moments entertained a near-capacity 24,000 crowd on a sticky night in Arthur Ashe Stadium.
"It was a really high-level match," said Medvedev, who compared Kyrgios' level to that of Novak Djokovic and Rafael Nadal.
"If he plays like this until the end of the tournament, he has all the chances to win it. But he's going to get tough opponents, so it's not sure."
Kyrgios took first blood for a 4-2 lead in the first set, whipping up the fans before he converted the break point, with Medvedev mimicking his opponent's actions as he instantly hit back.
A tense tie-break, packed with quality and drama, saw Kyrgios save three set points and twice clatter his racquet against the court before converting the fourth opportunity of his own to take the lead.
"I feel like if he'd got that first set, it was going to be pretty much an impossible task for me to come back and win," said Kyrgios.
Kyrgios popped off for a bathroom break after the 64-minute opener as a shirtless Medvedev complained to the umpire about the noise from the Australian's box while he was serving.
A different Kyrgios emerged - and not the one which the crowd, whose support was tipped in his favour, wanted to see.
With his first-serve percentage plummeting, Kyrgios played with nonchalance bordering on disinterest as he fell 5-1 behind.
One of the breaks was retrieved when he hit a brilliant crosscourt winner for 5-2 and he threatened to wipe out the other before Medvedev recovered to serve out the set.
The Kyrgios Show resumed in the third set.
After holding for 1-0, he slipped at 30-15 in the next game and looked injured as he laid out on the court, prompting Medvedev to come round the net to check if he was OK.
The pair tapped hands as Kyrgios reassured him he was fine and when play continued there was another extraordinary moment in the next point.
Kyrgios forced Medvedev into a volley which was looping out on the Russian's side of the net and Kyrgios decided to come around the post to hammer it into the court.
That was a foul shot and he lost the point as a result, meaning he did not get the break-point opportunity and Medvedev went on to hold.
While that felt like a considerable and perhaps pivotal moment, Kyrgios refocused quickly to break for 3-1 anyway and served out to regain the lead.
Now it was Medvedev's turn to pop off court and, while Kyrgios waited for his return, he showed how much he was in the zone.
Jumping off his seat and keeping loose, that energy remained as he broke twice to race into a 5-1 lead.
Many of the crowd rose to their feet when Kyrgios brought up match point and stayed on them as he quickly thumped an ace down the middle to seal a memorable win.
The rivals shared an embrace full of shoulder-patting before Kyrgios pointed to the court as he drew acclaim and then joined the crowd in clapping Medvedev back to the locker room.
"I feel like tonight was another message that rankings don't matter," said Kyrgios.
Who else is through to the men's quarter-finals?
Italian 13th seed Matteo Berrettini secured his place in the quarter-finals for a second successive year with a five-set win over unseeded Alejandro Davidovich Fokina on Louis Armstrong Stadium.
Berrettini, who reach the semi-finals in 2019 and knocked out Andy Murray in the previous round, overcame the Spaniard 3-6 7-6 (7-2) 6-3 4-6 6-2.
Davidovich Fokina suffered a knee injury when trailing 4-2 in the fifth set and could not fight back.
Berrettini will face Norway's Casper Ruud who beat France's Corentin Moutet.
Fifth seed Ruud ended the lucky loser's fairytale run to a maiden Grand Slam fourth round, winning 6-1 6-2 6-7 (4-7) 6-2.
Moutet, the world number 112, was the first men's lucky loser to play in the last 16 at a Grand Slam since Stephane Robert at the 2014 Australian Open.
French Open finalist Ruud, ranked seventh in the world, is one of four players in contention to be world number one at the end of the tournament.