MELBOURNE, Australia — 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 U.S. Open champion defeated Federer 6-4, 6-7 (5), 6-3, 6-7 (2), 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 the final (3 a.m., ESPN) 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 U.S. 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 U.S. 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 lost three times to Federer in a major 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,” he 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.”

The first title of the 2013 Australian Open, women’s doubles, was decided Friday when top-seeded Sara Errani and Roberta Vinci of Italy beat unseeded Australians Ashleigh Barty and Casey Dellacqua 6-2, 3-6, 6-2.