The 17-time Grand Slam winner beat the Briton 6-3, 6-4, 6-7 (6-8), 6-3 in the Rod Laver Arena in Melbourne.
Federer appeared to be cruising until the third set when Murray fought back before the Basel native regained control of the match that lasted three hours and 20 minutes.
The Swiss player, ranked sixth in the world, has not won a Grand Slam tournament since he defeated Murray at Wimbledon in 2012.
Nadal took four sets to dispose of Grigor Dimitrov, setting up another match with his rival.
Federer's victory leaves open the possibility of an all-Swiss final, with fellow countryman Stanislas Wawrinka set to take on the Czech Republic's Tomas Berdych in the other semifinal.