The 36-year-old prevailed in a five-set encounter (6-2, 6-7, 6-3, 3-6, 6-1) over the Croatian, who played some of his best tennis but was not strong enough to beat Federer.
This is the Swiss tennis star's sixth Australian Open title and makes him the oldest winner in Melbourne since Ken Rosewall in 1972.
On court during the presentation, an emotional Federer said: "I'm so happy, it's unbelievable.
"It's a dream come true and the fairytale continues.
"It's been a long time waiting for this final. It's easier in the afternoon, but when it's at night you think about it all day.
"I'm happy it's over now. After the year I had last year, it's incredible."
His opponent Cilic said: "It was an amazing journey for me to come here to the final.
"I had a slight chance at the beginning of the fifth, but Roger played a great fifth set."