An ailing Rafael Nadal battled to a five-set victory over Denis Shapovalov in a dramatic Australian Open quarter-final.

Nadal lost from two sets up against Stefanos Tsitsipas at the same stage last year and it appeared the same may well happen when Shapovalov forced a decider on Rod Laver Arena.

But Nadal, who had called the trainer for a stomach issue during the fourth set, made his experience count to move ahead early in the fifth and hold on for a 6-3 6-4 4-6 3-6 6-3 victory.

A relieved Nadal said: "I was completely destroyed. Very tough day, very warm. I didn't practise for it.

"I was a little bit lucky at the beginning of the fifth. At the beginning of the match I was playing great but I know how difficult it is to play against a player like Denis.

"For me it's amazing to be in the semi-finals."

The broken racket of Denis Shapovalov after losing his match to Rafa Nadal

Importantly, the 35-year-old now has two days off to try to recover physically before his semi-final against Matteo Berrettini.

"I started to feel not very well in my stomach," said the sixth seed. "I think I was lucky that I was serving great in the fifth. It was a great test and I really believe I'm going to be ready for that semi-final."

Nadal was not considered among the big favourites at the start of the fortnight having not competed for half of last season because of a foot problem.

But he played himself into that position, dropping only one set to Karen Khachanov during the first four rounds and raising hopes that he could win a record 21st grand slam title.

Shapovalov pulled off one of the biggest victories of his career over third seed Alexander Zverev in the fourth round to reach his third slam quarter-final and first in Melbourne.

The 22-year-old was unable to find his best form in the opening set, though, and then showed his frustration by getting into a row with umpire Carlos Bernardes over the time Nadal was taking between points.

After Bernardes refused to give Nadal a time violation for delaying Shapovalov on his serve, the Canadian shouted: "You guys are all corrupt," and he and Nadal then had words at the net.

It did not distract Nadal, who moved into a two-set lead, but Shapovalov began to turn the tide in the third set and clinched it with a backhand winner after his opponent was given a time violation.

Nadal began to look weary and troubled in the fourth set, leaving the court for six and a half minutes at the end of it for a medical examination and a toilet break.

Two double faults – he served 11 during the match – put him in trouble in the opening game of the decider but Shapovalov could not take advantage and then dropped serve himself to give Nadal a lifeline.

The Spaniard seized it, finding more conviction in his shots again and exploiting costly errors from his opponent, who will feel he had the match in his grasp.

When a final backhand volley drifted wide, Shapovalov smashed his racket angrily on the court while Nadal celebrated reaching his 36th grand slam semi-final.

We need your consent to load this YouTube contentWe use YouTube to manage extra content that can set cookies on your device and collect data about your activity. Please review their details and accept them to load the content.Manage Preferences

Afterwards, the Canadian apologised for his outburst at the umpire, but stood by his assertion that the 20-time grand slam winner is afforded preferential treatment.

"I think I misspoke when I said he's corrupt or whatever I said," explained Shapovalov during his press conference. "It's definitely emotional but I do stand by my side. I think it's unfair how much Rafa is getting away with.

"I'm completely ready to play and the clock is ticking, clicking towards zero, and I’m looking at the umpire and obviously I’m going to speak up and say something.

"I’ve been ready to play for a minute and a half and he tells me he’s not going to give him a code violation because I’m not ready to play. To me, it’s a big joke.

"And then after the fourth set – last year I wasn’t allowed to take a toilet break when I asked for a medical. He had already taken two medicals. He was getting medically evaluated, and after the evaluation the guy goes and takes a toilet break.

"It’s like, where is the line? I respect everything that Rafa has done and I think he’s an unbelievable player. But there’s got to be some boundaries. It’s just so frustrating as a player. You feel like you’re not just playing against the player, you’re playing against the umpires, you’re playing against so much more."

Asked if he feels Nadal receives preferential treatment, Shapovalov said: "Of course, 100% he does."

Nadal gave a forceful response denying Shapovalov’s accusations, saying: "I really believe that it’s always in the mind that the top players get bigger advantages and, honestly, on court it’s not true.

"That’s my feeling. I never feel that I had advantages on court, and I really believe that he’s wrong in that case. In the last couple of years we have a clock, we increase the measures to make the things more fair for everyone.

"I honestly feel sorry for him. I think he played a great match for a long time. Of course, it’s tough to accept to lose a match like this, especially after I was feeling destroyed and probably he felt that, and then I was able to manage to win the match.

"I wish him all the very best. He’s young, and I think we all make mistakes in our careers. I make a lot of mistakes, too, when I was younger, and probably he will understand later on after he thinks the proper way that probably he was not right today."

Seventh seed Berrettini become the first Italian man to reach the last four in Melbourne after seeing off Gael Monfils 6-4 6-4 3-6 3-6 6-2 in another marathon match.

Like Nadal, Berrettini looked in control at two sets to love up only for crowd favourite Monfils to fight back and level the match as the clock ticked past midnight.

Berrettini was the steadier in the decider, though, and the 25-year-old said after his win: "It feels unbelievable. I'm really happy for myself. It was a great fight against Gael. I thought I had him in the third and then I found myself in the fifth."

Umpire James Keothavong had to appeal to some unruly fans in the crowd several times to respect both players.

"Some of them are not really tennis fans I think," said Berrettini after he was heckled during his on-court interview. "It’s fine. I win, I’m happy."