The U.S. Open champion stayed in the hunt for a second consecutive major title with a 6-4, 6-7 (5), 6-3, 6-7 (2), 6-2 win over the 17-time Grand Slam champion at the Australian Open on Friday.
Murray will play defending champion and top-seeded Novak Djokovic, who was rarely troubled while beating David Ferrer in straight sets in just under 90 minutes on Thursday night -- about 2½ hours less than Friday's semifinal.
Advantage to Djokovic, then, for the Sunday night final.
While U.S. Open champion Murray came into the match with a 10-9 career advantage, he had never beaten Federer in the three times they had met in majors -- at finals at the 2008 U.S. Open, 2010 Australian Open and last year at Wimbledon.
"It's always tough against him when he plays his best tennis," Murray said, explaining why he was unable to close out the victory while serving for the match at 6-5 in the fourth set. "I was obviously very nervous. He plays his best tennis when his back is against the wall."
Federer outplayed Murray at stages of the match, but the 25-year-old Scot appeared to have the legs and stamina to give him the advantage over the 31-year-old Federer in the fifth set, including a service break to clinch the tense match.
With a capacity crowd of 15,000 at Rod Laver Arena watching, including Australian legend Laver himself, Federer opened the match serving and was in trouble early, losing a 28-rally point to set up break point for Murray. But Federer held the game with a stunning cross-court forehand that just looped over the net from the baseline.
Murray, who had not lost a set through five rounds at Melbourne Park this year, had the first service break -- on his fourth break point -- to lead 2-1. It came in unusually cool summer conditions in Melbourne -- breezy and with temperatures of only 60 degrees during most of the match.
There were no service breaks or even break-point chances in the second set, resulting in the tiebreaker that Federer dominated early to take a 4-1 lead. But Murray fought back to level at 5-5 before Federer secured a set point with a cross-court return of Murray's smash attempt. The Swiss star clinched the tiebreaker and the 58-minute second set when Murray hit a forehand long on the next point.
The crowd was initially evenly split between Federer and Murray supporters -- and at times, they were competing to be heard. At one point in the second set, a group of Murray fans wearing white shirts with blue letters spelling his nickname "Muzza" stood to chant Murray's name, while a group of Federer supporters with Swiss flags on their cheeks and shirts chanted Federer's name.
Murray broke Federer's service in the sixth game of the third set, clinched when Federer's attempted backhand in the left corner went long, then consolidated the break with a strong service game that included his 14th ace of the match to go up 5-2.
Federer, hampered by a 56 percent first-serve percentage through the first seven games of the set, managed to hold his service in the next. But Murray took a 2-1 set lead in the next game, clinching the game and the set with an ace.
With the crowd chanting "Let's go, Roger, let's go," Federer grabbed back the momentum by breaking Murray for the first time in the match, then held his next service game before Murray won the next three games.
There was some controversy in that leveling game when Murray thought he had game point on a shot to the baseline, but it was overruled by a linesman. He eventually held to level the set at 4-4, then 5-5 before the late exchange of service breaks that sent the set to another tiebreaker won by Federer, sending the match to a fifth set.
Earlier Friday, top-seeded Sara Errani and Roberta Vinci of Italy won the first title of 2013 at Melbourne Park, beating the unseeded Australian pair of Ashleigh Barty and Casey Dellacqua 6-2, 3-6, 6-2 for the women's doubles championship.
The 16-year-old Barty was attempting to become the youngest Grand Slam champion since Martina Hingis won the Australian Open singles title in 1997.
On Saturday, defending champion Victoria Azarenka plays sixth-seeded Li Na of China for the women's singles title. Li lost the Australian Open final to Kim Clijsters in 2011 two months before winning her first and only Grand Slam at the French Open.
"Last time was more exciting, (more) nervous because it was my first time to be in a final," Li said Friday. "But I think this time (I'm) more calmed down, more cool."
Azarenka leads 5-4 in career matches, including the last four times they've played.
"I'm really hungry to defend my title," said Azarenka, who needs to beat Li to retain her No. 1 ranking. "I've put myself in the position to give it the best shot."
Also on Saturday, American brothers Bob and Mike Bryan will play their fifth consecutive Australian Open doubles final and attempt to win their record 13th Grand Slam doubles championship. They'll play the Dutch pair of Robin Haase and Igor Sijsling.
Four-time Australian Open champion Andre Agassi, returning to Melbourne after his retirement in 2006, said he's glad his career ended before the age of the so-called Big Four of men's tennis began because he doesn't think he'd be able to compete against the group -- Federer, Rafael Nadal, Djokovic and Murray.
The game bears little resemblance to how he played just a decade ago, Agassi said. He "marvels" at the athletic ability of the top men's players these days -- and their ability to recover quickly after draining matches, such as Djokovic's five-set victory over Stanislas Wawrinka in the quarterfinals this year.
"It's just a different standard of tennis," Agassi said. "They're more calculated now, they play slower, so six hours is not the same six hours that I played. But they're also much better athletes. They also appear to be, lower body, a lot stronger than I was; upper body, probably not as much. But my game was never about using my legs as much as it was, you know, bullying the ball around the court.
"It means the game has gotten a lot better. You know, Fed raised it. Nadal matched and raised it. Djokovic, for that intense little period of time, even raised it," Agassi said. "When I see those top three guys, I see what history will say is the golden age of tennis. You're talking about arguably the three best guys."
When asked what he'd need to do to beat a player of Djokovic's caliber, Agassi wisecracked, "I would have probably gotten in a fight with him in the locker room before the match. I might have had a chance."
Information from The Associated Press was used in this report.