MELBOURNE — Andy Murray was sucking in deep breaths, trying to recover from his exhausting win over Roger Federer. Pain was very much on his mind.
The US Open champion defeated Federer, 6-4, 6-7 (5-7), 6-3, 6-7 (2-7), 6-2, in a four-hour Australian Open semifinal Friday night. It was Murray’s first victory against the 17-time major winner at a Grand Slam event.
But with the clock about to strike midnight, Murray was already thinking about Sunday’s final against two-time defending champion Novak Djokovic, who is on a 20-match winning streak at Melbourne Park. This will be a rematch of their US Open final.
‘‘Every time we play each other it’s normally a very physical match,’’ Murray said. ‘‘I’ll need to be ready for the pain. I hope it’s a painful match — that’ll mean it’s a good one.’’
Murray had a 10-9 record against Federer, but had lost his three previous Grand Slam matches to the Swiss star. One of those defeats came at Wimbledon last year. Murray says the disappointment of that loss triggered his run to the gold medal at the London Olympics, and then his drought-breaking triumph at the US Open.
‘‘You know, I’ve obviously lost some tough matches against him in Slams,’’ Murray said. ‘‘So to win one, especially the way that it went tonight, yeah, was obviously nice.’’
Murray ended a 76-year drought for British men at the majors when he beat Djokovic in five sets in the final at Flushing Meadows.
He’s hoping the step-by-step manner in which he has crossed career milestones off his to-do list will continue Sunday.
He lost four major finals, including two in Australia, before winning a Grand Slam title. He lost three times to Federer in majors before beating him.
Even then, he wasted a chance to serve out in the fourth set Friday night as Federer rallied.
‘‘Those matches . . . have helped obviously mentally,’’ Murray said. ‘‘I think going through a lot of the losses that I’ve had will have helped me, as well. Obviously, having won against Novak before in a Slam final will help mentally.’’
Federer showed flashes of his customary genius, but also rare bursts of anger. Murray showed his frustration, as well. The crowd of 15,000 at Rod Laver Arena started to turn on him after he challenged a call in the eighth game of the fourth set, booing each time he complained. His unforced error into the net on the next point prompted a huge cheer.
In the 12th game of the fourth set, Federer appeared to yell across the net after Murray stopped momentarily behind the baseline during the rally.
Murray shrugged it off and seemed to dig in. He’d won that point but lost the game and was taken to another tiebreaker, which he lost.
‘‘We were just checking each other out for bit,’’ Federer said. ‘‘That wasn’t a big deal for me — I hope not for him.’’
Murray said ‘‘stuff like that happens daily in tennis,’’ and added that it was ‘‘very, very mild in comparison to what happens in other sports.’’
When Federer got break point with Murray serving for the match at 6-5, the applause was so prolonged Murray had to wait to serve. And when Federer got the break to force a tiebreaker, the crowd stood and roared as Murray slammed a ball into the court in anger.
The crowd cheered for every Murray error in tiebreaker. One man yelled, ‘‘Andy, don’t choke.’’
Rather than wilting in the fifth set, Murray hit his stride. He allowed Federer only four points in the first three games of the fifth set, bolting to a 3-0 lead and carrying it through to the end.
‘‘It’s big. I never beat Roger in a Slam before. It definitely will help with the confidence,’’ Murray said. ‘‘Just knowing you can win against those guys in big matches definitely helps.’’
Federer could see improvement in Murray’s approach in the tough situations.
‘‘With the win at the Olympics and the US Open, maybe there’s just a little bit more belief,’’ Federer said. ‘‘Or he’s a bit more calm overall.’’