After going two sets to one up and a break ahead, it appeared Federer would wrap up his 20th title in relatively quick fashion.
But from midway in the fourth set, Cilic won five games in a row and send the match into a deciding set.
However, Federer lifted his game again and broke twice in the final set to win his sixth Australian Open.
After collecting his trophy, Federer fought back the tears as he thanked his family, support team and fans.
And speaking to Australia’s Channel 7, Federer explained why he was so emotional.
He said: “This win reminded me more of 2006 when I beat Baghdatis. Had a great run to the final, I was the huge favourite.
“I was just relieved when everything was said and done. It was the same tonight. That’s why I couldn’t speak… I was terrible.