Recent meetings with Nadal have been laced with acrimony but here the Australian was on his best behaviour in defeat

Nick Kyrgios invariably plays his best tennis when he generates his own drama rather than when someone else writes the script – like an army of moralists poring over his every twitch. He is dangerous when his muscles are warm and loose, and his head clear. He feeds off good vibes and suffers when railing against demons, real and perceived.

What mixed baggage, then, he took on to Rod Laver Arena on Monday night against Rafael Nadal, whom he respects but does not regard with particular affection. That was the edginess punters came to witness. They wanted a tennis punch-up. They got one of the best contests of the first eight days, and a Nadal victory in four sets: 6-3, 3-6, 7-6 (6), 7-6 (4).

There was more than a tennis match going on here, though. Kyrgios, a passionate basketball fan and admirer of Kobe Bryant, warmed up in a Lakers shirt to mark his hero’s passing in a helicopter crash in Los Angeles on Sunday. His heart pumped loudly through his salmon pink T-shirt, as ever. Would his emotions overwhelm him?

The backdrop of tragedy created a complicated narrative for Kyrgios, who is 25 in April. He had business to take care of. He was playing an opponent who owns 19 majors. Sure, he’d beaten Nadal before: memorably as a teenager at Wimbledon in 2014, and twice on hard courts, in Cincinnati in 2017 and in Acapulco last year when their rivalry bubbled up into acrimony. But he had lost to him four times, as well. No shame there. Just accrued frustration.

Kyrgios said after the win in Mexico that Nadal was a “super salty” loser. Reminded this week of the barbed comment, Nadal said: “I don’t know him personally, honestly, to have a clear opinion.” Which is opinion enough.

The last time they played, Kyrgios affected swaggering, dude-like nonchalance, preparing with a couple of pints in Wimbledon village last summer, the night before their second-round match. When they went at it, Kyrgios speared the Spaniard with a full-blooded shot from the baseline which produced a long, withering stare from Nadal. Kyrgios loved that immensely. And lost.

This time, he left a week between a quiet midnight libation at a Melbourne bar and the serious stuff of trying to get into the quarter-finals of the Australian Open for the second time. That’s dedication for you.

From the opening bell, this fourth-round ding-dong felt more like a world title fight, the Australian doing his best to knock the old boy’s head off. Kyrgios’s best chance was a quick knockout. Three aces in the first quarter of an hour signalled his bad intentions. But his early, wild haymakers caught the net too often, or strayed long. Round one whizzed by.

The tattoo on Kyrgios’s right hand reads “Inspire others” – which is a better message than some he has sent down the years. However – whether because of the probation period which has shackled his outbursts recently or his late maturing – he has recently gone from villain to good guy in Australia, lifting a nation’s morale by leading the charity calls to help bushfire victims. His tennis has hit a new pitch as well.

Invariably, Kyrgios is involved in the most engrossing matches at any tournament, often for the right reasons. Even against the unseeded Italian, Lorenzo Sonego, he needed two tense tie-breaks to squeeze into the second round. Gilles Simon stretched him over four sets, and another tie-break; then he had to get into the trenches with Karen Khachanov, who kept him on his favourite battlefield, Melbourne Arena, for nearly four-and-a-half hours, four sets and three more tie-breaks. Only John Isner, surely, plays in more shootouts in big tournaments.

When Kyrgios stood on court on Saturday night, plainly drained, answering questions from Jim Courier after his third win of the week, he looked despairingly at his American inquisitor and said: “Mate, both my legs weigh about 40kg at the moment.”

They did not look a lot lighter in the early exchanges against Nadal, who was as feather-footed as ever. He sensed Kyrgios would, at some point, let his heart tell his racket what his head would not – and going for a second-serve ace at 6-6 in the tie-break was it.

For all that Nadal has as much flair in him as anyone, he will opt for the correct and safe option nearly every time – which unsettled Kyrgios, who wanted to trade genius. The older man is also a master at husbanding his resources, rarely looks near collapse, always moving with economy. At 6-5 in the third, Nadal did more running in one point than Mo Farah does in a week. It bamboozled his younger opponent.

Under pressure, Nadal goes back to basics; Kyrgios often, but not this night, goes to pieces. At 1-2 and a break down in the fourth, the world No 26 was on the ropes; there would be no knockout. He did not give up. After three hours, he was still banging down aces, his 22nd for the match, 97th for the week. With sponsors kicking in, that was worth nearly A$100,000 (£51,000) to the victims of the bushfires still roaring in the distance.

Kyrgios would love a century of aces, for symmetry and charity. Serving to stay in the tournament, he added two down the T for 99, and held. Then he broke. The script was in his hand once more. But he stumbled again. So did Nadal. Tie-break time – and the 100th ace arrived, but too late.

Economy of thought and movement triumphed over anarchic freewheeling. It was done, a minor masterpiece lasting three hours and 38 minutes. The Entertainment Man and his Spanish straight man had given everyone something to smile about – including themselves. It was not a bad result.