The Swiss maestro defeated Nadal 6-4, 3-6, 6-1, 3-6, 6-3 at Rod Laver Arena in the final match that lasted for more than two-and-a-half hours.
Federer, the 17th seed, hit 73 winners, including 20 aces, and won 76 per cent of his first service points for victory in three hours and 37 minutes. The Spaniard, who went 4/17 in break points won, committed 28 unforced errors- 29 fewer than Federer.
It was Federer's fifth Australian Open title and 18th major crown in all.
With the win, the 35-year-old Swiss extended his lead over Nadal in the all-time major wins list to four with his first Melbourne Park crown since 2010, and his fist major title win since Wimbledon 2012.
This was Federer's first win over Nadal in four meetings at the Australian Open. Federer also won his third major final over the Spaniard in nine attempts.