Roger Federer beat fellow Swiss Stan Wawrinka 7-5 6-3 1-6 4-6 6-3 to reach the Australian Open final and stay on course for an 18th Grand Slam title.
The 35-year-old will face Rafael Nadal on Sunday if the Spaniard beats Grigor Dimitrov in Friday’s semi-final.
The Swiss, returning from a six-month lay-off to rest his left knee, last won a major at Wimbledon in 2012.
He is the oldest man to reach a Grand Slam final since Ken Rosewall did so at the 1974 US Open at the age of 39.
“I couldn’t be happier right now,” said Federer. “I felt like everything happened so quickly at the end, I had to check the score.
“I never ever in my wildest dreams thought I’d come this far in Australia. It’s beautiful, I’m so happy.”
Federer’s extraordinary run in Melbourne had already seen him beat higher seeds Tomas Berdych and Kei Nishikori to reach the last four.
Seeded 17th following his injury, Federer had an 18-3 record against the fourth seed and reigning US Open champion coming into the semi-final, but the two had never played a five-set match.
Both players needed medical treatment during a match of high intensity but it was the 17-time Grand Slam winner who finally prevailed after three hours and five minutes.
Federer will now seek a fifth Australian Open title, and his first since in Melbourne since 2010, when he plays in his 28th Grand Slam final on Sunday.