The British number one will face top seed Novak Djokovic of Serbia for the title on Sunday.
Murray, who beat Djokovic in the US Open final last September, won his semi in Melbourne 6-4 6-7 (5/7) 6-3 6-7 (2/7) 6-2 in four hours.
The 25-year-old Briton had never previously defeated Swiss star Federer in a grand slam tournament.
But third seed Murray had looked the more likely to win the match from the outset with a superior service game and aggressive shotmaking.
The Scot was two points away from winning the semi-final in the fourth set.
But 17-times grand slam winner Federer, who was seeded two, proved he was still a force to be reckoned with by forcing a fifth.
However, Murray got off to a storming start in the final set, racing to a 3-0 lead - and was not prepared to let an opportunity slip again.
The Briton has extended his victory record over Federer to 11-9, and it was his first victory over the former world number one in four grand slam matches.
It will be Murray's sixth grand slam final and he is the first Briton to reach three Australian Open finals.
Speaking afterwards, the Olympic gold medallist, who beat Federer in the final at London 2012, said: "It's always tough against him. Slams are when he plays his best tennis.
"When I was serving for the match at 6-5 in the fourth, he came up with some unbelievable shots.
"I didn't play the best tiebreak. It's hard when you're serving for a place in the final and a few minutes later you are into a fifth set."
As for the meeting with Djokovic, who thrashed David Ferrer in Thursday night's semi, he added: "I didn't see much of his game although I heard about it.
"I heard he played very well. I will have to play my best tennis to win it."
During the Murray match, Australian cricket legend Shane Warne raised a few smiles when he caught one of the balls.
- Sports & Recreation
- Roger Federer
- Andy Murray
- Novak Djokovic