Wawrinka made the 35-year-old Federer work in a 7-5 6-3 1-6 4-6 6-3 marathon, the first five-set match in their 22nd career meeting. But it was Wawrinka who buckled in the end.
The 31-year-old Wawrinka snapped his racquet into two pieces over his left knee and briefly left the court with a trainer for treatment on his right knee.
But he came back to win the third set in 26 minutes.
Federer also said he was ailing in the grueling match, and even took a medical stoppage of his own.
"I have had a leg thing going on for a week and felt it from the second game on in the match," he said. "If you go off the court, that means the treatment is further up the leg. I never take injury timeouts. Stan took his, so I thought people won't be mad. ... Stan won't be mad hopefully.
Federer meets the winner of Rafael Nadal-Grigor Dimitrov in Sunday's final. Winning the Australian Open would give Federer 18 Grand Slam titles.
"Rafa has presented me with the biggest challenge in the game," Federer said. "I'm his No. 1 fan. His game is tremendous. He's an incredible competitor. I'm happy we had some epic battles over the years and of course it would be unreal to play here. I think both of us would never have thought we would be here playing in the final."
Federer has been masterful in his return from a six-month layoff to rest his injured left knee, but last won a major at Wimbledon in 2012.
He last won the title in Melbourne in 2010.