Novak Djokovic will face Andy Murray in the final of the Australian Open for the third time in five years after edging another five-set encounter with defending champion Stan Wawrinka.
Four-time winner Djokovic had not dropped a set on his way to the semi-finals but was made to dig deep to win 7-6 (7/1) 3-6 6-4 4-6 6-0 in exactly three and a half hours on Rod Laver Arena.
It was the third year running Djokovic and Wawrinka had gone the distance in Melbourne, although Friday's contest lacked the quality and drama of their two previous encounters.
Djokovic beat Wawrinka 12-10 in the fifth set in the fourth round before claiming his third straight title in 2013, but Wawrinka ended the world number one's 25-match unbeaten run in the quarter-finals last year, winning 9-7 in the fifth.
"As it was the last two years we played five sets, I was ready for the battle," Djokovic said in an on-court interview. "It was a great battle, we pushed each other to the limit and credit to Stan for playing well.
"I think I played well up to 2-1 and a break up and then I played a couple of loose games, I allowed him to come back into the match and Stan is a quality player. He knows how to use his opportunities. I made my life very complicated.
"The opening game in the fifth set was very close and making the break was a crucial turning point. My game depends on how well I move and I was too defensive in the second and fourth set and Stan stepped it up after that. In the fifth set I managed to stay consistent and serve well when I needed to and am so glad to go through."
Asked about facing Murray again after beating him in 2011 and 2013, Djokovic added: "Andy and I go back to when we were 12 years old, there is only a week difference in age. We have a very friendly relationship so it's nice to see we are playing another grand slam final against each other.
"Hopefully we can come up with a good match."
Wawrinka claimed the first break of the match to lead 4-3 but was immediately broken back to love and had to save two set points to eventually force a tie-break, only for Djokovic to race through it 7-1.
A single break of serve was enough for Wawrinka to win the second set - Djokovic serving a double fault at 30-40 in the seventh game - and the players traded breaks early in the third, Djokovic letting slip a 3-0 lead.
It was getting harder and harder to predict a winner and Djokovic did not even realise he had won the third set with a break of serve in the 10th game, the world number one waiting at the back of court to serve before he acknowledged his mistake with a sheepish grin.
"You get carried away by the moment, by circumstances of playing a semi-final against the defending champion," Djokovic admitted later. "There is a lot of tension and emotions going around, sometimes you can't keep track of the score."
Djokovic looked to have one foot in the final when he broke for a 2-0 lead in the fourth set but squandered the advantage with a string of uncharacteristic unforced errors, Wawrinka taking full advantage with another break in the seventh game to level the match.
Another decider was no surprise but the scoreline in it was, Djokovic saving a break point in the opening game and winning six games in succession as Wawrinka unexpectedly crumbled.
The Swiss star will drop to ninth in the world rankings when they are released on Monday as a result.