Rafael Nadal suffered his first lost set of the tournament but rode out a challenge from a wholly committed Nick Kyrgios to move into the quarter-finals of the Australian Open for the 12th time with a 6-3, 3-6, 7-6(6), 7-6(4) victory on Monday.
Kyrgios was a match for the 19-times Grand Slam champion in the second set and for much of the third but the muscle-bound Spaniard looked like the most likely winner once he got his nose back in front.
The Australian, however, broke back when Nadal was serving for the match in the fourth set, reigniting the contest and bringing the partisan Rod Laver Arena crowd back into the equation.
The world number one gritted his teeth and went again in the tiebreak and moved through to a last-eight meeting with Austrian Dominic Thiem when Kyrgios netted a forehand after three hours and 38 minutes.
"It was a very tough match, it seemed like I had control at the start, but against Nick you are never in control," said Nadal, who hit 64 winners to Kyrgios's 50.
Kyrgios showed once again he has the skills to be a Grand Slam champion and will console himself at having shown more of the mental fortitude and discipline he will need to win major prizes.
"When he is playing like today with this positive attitude, he gives a lot of positive things to our sport," said Nadal, who has previously criticised Kyrgios's behaviour. "He is one of the best talents we have. I like the Nick Kyrgios of this tournament."
The match was preceded by a ceremony honouring the 50th anniversary of the Grand Slam achieved by Margaret Court, once adored by Australians for her tennis prowess but now a more divisive figure because of her opposition to same-sex marriage.
Kyrgios has proved divisive himself due to his on-court antics, but has earned praise in recent weeks for kickstarting the Tennis Australia bushfire relief appeal which has raised more than A$5.6 million ($3.8 million)
There was a more recent tragedy on his mind on Monday and he sported an LA Lakers shirt in the warm-up. A basketball fanatic, Kyrgios appeared to be close to tears as he walked out on court only a few hours after the death of Kobe Bryant.
"It's horrible news," said Kyrgios. "(But) if anything, it motivated me. If you look at the things he stood for, what he wanted to be remembered by, it helped me tonight."
"When I was down a break in the fourth, I was definitely thinking about it. I fought back."
After the match Nadal described Bryant as 'one of the greatest sportsmen in history' - an elite he would surely also rank among.
He has always found Kyrgios a tricky proposition, however, and held only a 4-3 career record against the Australian.
The Spaniard looked well on the way to making that 5-3 when he raced through the first set against a slow-starting Kyrgios in cool, blustery conditions.
Kyrgios needed 14 minutes to hold at the start of the second set but two games later had a break when his forehand pass at the end of an 18-shot rally just kissed the baseline.
The Australian served out the set with two aces and, with the crowd roaring his every point, the contest moved into a blockbuster of a 72-minute third set.
The pair slugged it out through one intense game after another and on to an equally tough tiebreak, which Nadal, also feeling the pressure, sealed despite passing up one set point with a double fault.
The Australian handed Nadal an early break for 2-1 lead in the fourth with a double fault, but the 'new' Nick Kyrgios was not about to lie down and took the set to its dramatic conclusion in the tiebreak.
"I'm shattered to have lost tonight," said Kyrgios. "(But) I feel like I've made progress as a human (this summer) ... I want to keep going in this direction, for sure."
Aus Open: Tennis stars pay tribute to Kobe Bryant
Kobe Bryant, daughter died pursuing basketball dream
Kohli, Tendulkar pay tribute to 'magician' Kobe Bryant
Bryant was one of basketball's greatest