Federer came out firing but Nadal gradually wore him down to clinch a 6-7 (5/7) 6-2 7-6 (7/5) 6-4 win in three hours and 42 minutes and secure his place in Sunday night's title decider against Novak Djokovic or Andy Murray.
Federer versus Nadal remains one of sport's great rivalries and this was another classic - both players slugging it out until Nadal broke crucially for a 5-4 fourth-set lead before serving it out.
In the first three games, Federer was simply brilliant.
A routine hold was followed by a break, set up by two thundering backhands. And when he opened the third game with a stop volley and a drop shot it was a sign the confidence was flowing.
Nadal was simply trying to stay with him and he did well to stem the tide with two holds.
The world number two was then gifted a way back into the set when Federer unexpectedly shanked three routine groundstrokes to relinquish his serve.
The set went to a tie-break which the Swiss claimed with a solitary mini-break.
The pair traded breaks at the start of the second before Nadal upped the tempo by racing to 0-40 at 3-2 and, although Federer applied the pressure by getting it back to 30-40, a sublime cross-court winner from Nadal, played from five yards wide of the tramline, restored his advantage.
The 10-time grand slam winner held for 5-2 before the match was suspended for 10 minutes for a nearby firework display to celebrate Australia Day.
And when they returned Federer's game deserted him.
Nadal broke again to take the set and then held his own serve to love. And when he raced to 0-40 on the Federer serve, the Spaniard had won 11 successive points since the resumption.
Federer, though, refused to buckle and dragged it back to deuce before making it 1-1.
And the Swiss remained on the front foot by breaking only to toss the advantage away again as Nadal hit back for 4-4.
Federer had to save a set point at 5-6 - a booming serve and a winning forehand doing the trick - but Nadal seized the initiative in the second breaker by racing to 6-1.
The four-time Melbourne champion dragged it back to 6-5 but Nadal was not to be denied.
If the first three sets were good, the level moved up a notch in the fourth with both players flat out.
And it was Nadal who continued to offer the greater threat as Federer had to stave off break points in the third and fifth games to keep it on serve.
The Swiss was next to threaten as the momentum swung one way and then the other.
But he missed a backhand pass by the narrowest of margins on break point as Nadal held on.
It proved a crucial moment as Nadal grabbed the break in the next game, Federer thrashing a backhand wide.
Even then the drama was not over as Federer bravely attempted one last time to stay in it.
Having saved one match point as a Nadal pass missed by inches, he set up a break point for 5-5.
And he must have thought he had it when a Nadal groundstroke sat up invitingly off the top of the net. He powered a forehand deep and came in only for a desperate Nadal lob at full stretch to land on the back half of the baseline. Federer's ensuing sliced smash was wide.
He set up another break point but could only net a backhand and it was to prove his last chance as Nadal served it out.