MELBOURNE, Australia — Carlos Alcaraz thrives when the tennis record books are within reach, and he has to do hard things to write his name in them.

With a scrambling, grinding, comeback win in the Australian Open final over the greatest player the sport has ever known, Alcaraz showed Novak Djokovic and the rest of the world they shouldn’t doubt his dream of becoming the greatest player ever, or that he can turn a match in a single point as no one else can.

“I hate to lose, that’s my motivation,” Alcaraz said after taking a gulp of champagne at his post-match news conference.

On the sort of cool night at Melbourne Park where Djokovic has thrived so many times before, Alcaraz’s 2-6, 6-2, 6-3, 7-5 win gave him his seventh Grand Slam title and his first win in Australia.

When Djokovic’s forehand sailed long, three hours and 2 minutes after the duel started, Alcaraz collapsed on his back in euphoria. By the time he rose, Djokovic was on the other side of the net. The two greats, one so young and still beginning, the other 16 years older and nearing the end, shared a hug.

Djokovic congratulated the new champion.

“I told him it is always a pleasure to play him,” Alcaraz said. “It is a privilege.”

It was far more than than that.  This was the latest move in his assault on the sport’s Mount Rushmore. Four years ago, when Alcaraz won the U.S. Open at 19, he became the youngest male player to achieve the world No. 1 ranking.

The next year he knocked off Djokovic in five sets on Centre Court at Wimbledon. Djokovic hadn’t lost on the grass that had long felt like his living room for six years and five tournaments when it happened.

Last year, Alcaraz saved three championship points and went on to win the longest French Open final ever played, against his nearest rival at the top of the sport, Jannik Sinner.

Sunday night in Rod Laver Arena, he became the youngest man in the history of the sport to complete the career Grand Slam, a rare feat that only players who can figure out how to thrive on hard courts, clay, and grass are able to achieve.

And he did it with his Spanish compatriot, Rafael Nadal, sitting in the front row to watch Alcaraz write his name on that line in the tennis record book. He did it with Djokovic on the other side of the net, knowing that Alcaraz is planning to come after his records, too.

“Nobody knows how hard I have been working,” Alcaraz said during the trophy ceremony, pushing back against the idea that he’s doing all this on preternatural talent.

That is a big part of it, of course.

Carlos Alcaraz and Novak Djokovic duel at the net on Rod Laver Arena.

Carlos Alcaraz became the first player to beat Novak Djokovic in an Australian Open final. (Getty Images)

Djokovic has won 10 Australian Open titles. Perhaps more astounding, he’d never lost a final in Melbourne before Sunday night.

So many other younger opponents who had faced Djokovic in the setting got hit on the chin the way Alcaraz did in the first set and never recovered. Djokovic came out playing the kind of tennis that has dominated this tournament for nearly 20 years.

All those serve returns that sent Alcaraz running backwards. That extra pop on his forehand that seemed to make it defy physics and speed up as it crossed the net rather than slowing down. Serves like lasers zapping at the lines.

A little more than a half hour after they started, Djokovic had a one-set lead, and it wasn’t even close.

The allure of this match rested with the rarity of the challenge that both players faced.

Alcaraz has been remaking his serve for more than six months now, tinkering and tweaking before each big event. Slowly, he had changed it from a liability into a weapon. But he hadn’t tested this version of it against the man with arguably the best return in the history of the game, a return that made it seem average at best, and had him scrambling for so much of the first set.

Alcaraz can sometimes struggle against Djokovic, as he did on this court on a temperate night last year in the quarterfinal. Going up against the GOAT can stress him out. Really, though, it’s the return, when it’s working, that scrambles his brain.

Djokovic, for his part, has mostly had his way with everyone not named Sinner or Alcaraz, using his immaculate touch and timing to tie them in knots as he puts the ball on every inch of the court and sends them running. It’s been a long time though since he faced someone here with Alcaraz’s speed and court coverage in a final. Maybe he never had.

Still, had the planets ever aligned for an aging superstar as they had for Djokovic during this Australian Open?

For three matches he’d been passable at best, and cranky at his worst. When his third-round match against Botic van de Zandschulp turned into a scrap, he got so cranky he whacked a ball that nearly hit a ballkid in the head. Had it hit them, he surely would have been defaulted.

After getting through that night, his next opponent, the young and dangerous Czech, Jakub Menšík, withdrew with an abdominal injury. That gave him a full three days of rest, and a glimmer of hope that if his play improved and he made it to the final four, he would have enough left in his legs to be competitive with Sinner, and then likely Alcaraz.

First he needed to get by Lorenzo Musetti in the quarterfinals, and that quickly went horribly wrong. Djokovic appeared lost and off-balance against Musetti’s mix of spins, looping off-speed strokes and high-powered forehands.

Down 2-0 and certain his tournament was ending, Djokovic looked up and saw Musetti limping in the corner of the court. Cruising to a win, the Italian had suffered what he believed was a muscle tear near his groin. Two games later, he retired.

Djokovic headed into his latest showdown with Sinner after having played two sets in six days and having lost them both. The rest helped give him the gas he needed to get through five sets and more than four hours against Sinner, but it was really Djokovic’s tennis — that impossibly aggressive, unplayable barrage of down-the-line winners and changes of direction — that stunned a player who had beaten him five times in a row into submission.

Then came the shot at the most remarkable accomplishment of his remarkable career. Not just a record 25th Grand Slam title, but barreling through Sinner and Alcaraz to lift it.

For a set, he was back in that flow state he had reached Friday night Whenever he needed a miracle shot, or a perfect serve, or one of his patented, sideline-breaking attacks from behind the baseline or off in a corner, he found it.

Oh, how he ran, getting his feet behind the ball and leathering shots into the postage stamps. It wasn’t effortless, but it looked that way. He lost just two of 18 points on his first serve.

There are limits to how long an athlete can stay in that state, especially when he is 38, and his opponent is 22 and digging in.

Heading into the second set, after getting pummeled in the first, Alcaraz knew something, something he never forgets.

“Tennis can change in just one point,” he said after the win. “One point, one feeling, one shot can change the whole match completely.”

Which one was it?

There was a run Alcaraz made at 2-1 in the second set, a point away from solidifying his first break of Djokovic’s serve. Djokovic hit a backhand that sent him scrambling to his right. It’s a winner against just about everyone. Alcaraz stretched and flicked his racket at the ball, sending it high toward the back of the court. The point had flipped. Alcaraz pummeled the next ball, drew a loopy volley, and drove his next shot down the line. Djokovic could only pat it into the net.

Alcaraz pumped his arm and screamed “Vamos” to the crowd. He was coming.

That sort of thing kept happening. Not every point, or every game, but enough to drive a 24-time Grand Slam champion a little mad.

In the third set, with Alcaraz serving down 1-2. Djokovic chased a short ball to his left and ripped a backhand around the net post. Last he had seen, Alcaraz was on the opposite side of the court. He hadn’t stayed there long. The Spaniard was there to block Djokovic’s drive, destined to be a winner, back into the open court.

Alcaraz put his finger to his ear. The crowd exploded. Djokovic put his hands on his hips in disbelief.

Only some of the miracle shots that saved him against Sinner were going to get him out of this hole. On this night, against this opponent, he couldn’t find them once the first set was over.

“One or two shots can change the momentum of the match and switch things around, which happened,” Djokovic said when it was over. “I’m just very disappointed I wasn’t able to maintain that kind of feeling that I had in the first set. You know, a lot of what-if scenarios in my head.”

Much of that is down to Alcaraz. This is what he has been doing for the better part of the last four years, during what has become — after a few early bumps — a stunningly efficient rise toward greatness

“I believe a legend is not made in three or four years on the tour,” he said in Spanish in his news conference. “A legend is made over a long time. Seeing a player in the same tournaments, the same ambition.”

He’s now won as many Grand Slam titles as John McEnroe won during his legendary career. He’s one off Jimmy Connors and Andre Agassi.

He also parted ways with his longtime coach Juan Carlos Ferrero in December, just weeks before the start of the season. He had never won a Grand slam title without him. No matter. The shots that Alcaraz so often finds when he needs to get over the line were always going to be there.

Just as he did at the U.S. Open last summer, when he desperately wanted revenge over Sinner, who had taken his Wimbledon title away, Alcaraz brought a relentlessness to the task in Australia. He was on the brink of elimination for the better part of three hours in the semifinals against Alexander Zverev, fighting his way through cramps, vomiting on the court, and then finally breaking Zverev when the German served for the match in the fifth set.

Then he faced the danger of the best player in history, on the court where he has had more success than any other, and he was taking a beating. And then he found those couple of shots that would make all the difference.

Alcaraz gets a tattoo after he wins each Grand Slam for the first time. After midnight Monday morning, he said, there would be a kangaroo on his leg before too long.

“This year is about appreciating and enjoying every single second of the moment you’re living, not only lifting the trophies, but playing tournaments, playing tennis, getting victories, getting losses,” he said.

“For me it’s an honor to put my name in the history books.”