Cilic recovered from two sets to one and a break down to force a fifth set but Federer proved stronger in the end to win 6-2 6-7 (5/7) 6-3 3-6 6-1 and join Novak Djokovic and Roy Emerson in claiming his sixth title in Melbourne.
The 36-year-old, the second oldest man to win a slam title behind Ken Rosewall, moves four clear again of Rafael Nadal in terms of overall titles and is only three behind Serena Williams and four adrift of all-time record holder Margaret Court.
Federer choked back tears at several points during his victory speech before breaking down completely as he turned to his wife Mirka and support team and said: “I love you guys.”
The defending champion said: “I think what happened is I got to the finals very quickly. The semis was cut short. I had a lot of emotions left in me because I didn’t have to go to the extreme like last year.
“I hoped over time in the speech I would start to relax a little bit, but I couldn’t. I wish it wasn’t so sometimes. At the same time, I’m happy I can show emotions and share it with the people.”
Federer revealed he had been unusually nervous ahead of the match and felt that was behind the uncharacteristic lapses that cost him two sets.
“You can’t explain it sometimes, it is just a feeling you get,” he said. “It’s like against (Tomas) Berdych (in the quarter-finals), I felt like I’m probably going to lose this one. I was not negative, but I just felt like I saw a loss was coming somehow.
“I didn’t fall asleep very well after the (Hyeon) Chung match. I think it surprised me that at this stage of a competition in the semis, to get a walkover. I couldn’t fall asleep until about three in the morning.
“All of the next day I was already thinking about how should I play Marin, how cool would it be to win 20, but no, don’t think of it, but how horrible would it be to lose it. I had it for over 36 hours, it was a lot.
“I needed to probably work through these emotions this way. That’s what made me nervous. I had a good start to the match. I think I lost the second because of nerves. It’s all good. I like to care. It’s good I can care about these matches.”
Inevitably, Federer faced questions about how long he will be able to maintain his remarkable form, but he sees no reason why he cannot continue challenging for the big titles as long as he does not overplay.
He said: “I’ve won three slams now in 12 months. I can’t believe it myself. I’ve just got to keep a good schedule, stay hungry, then maybe good things can happen. Then I don’t think age is an issue, per se. It’s just a number. There’s exciting times ahead.”
The crunch point of the match came at the start of the fifth set after Cilic had brilliantly battled from 3-1 down to win the fourth. He piled on the pressure in the opening game of the decider and had two break points but Federer saved them both. The second seed then broke serve in the next game and did not look back.
The Croatian was playing in his third grand slam final after winning the US Open in 2014 and losing to Federer at Wimbledon last summer. He exorcised some demons after breaking down in tears during the match at SW19 as he struggled with blisters and was proud of his efforts.
The 29-year-old said: “I’m feeling a little bit disappointed obviously. It was a big battle. I managed to turn it around. I was hitting the ball great. I was just playing phenomenal.
“Then the first game of the fifth set was more or less crucial at the end. It just ran away from me. But I’m really happy with the performance that I did.”
The match was played under the roof after the referee decided to implement the extreme heat policy even though it was an evening contest and the temperature had not hit the stated 40C threshold.
Federer described the decision as surprising while Cilic felt it contributed to him losing the first four games.
He said: “Throughout the tournament I played all my matches outdoors. I was preparing for a hot day. With the roof closed, it was way, way cooler than I expected.”