The 20-time grand slam singles champion overcame frustrations with the umpire and the powerful resilience of his opponent to win 6-2 2-6 7-6 (7-4) 6-2 on Thursday.
The Swiss great holds an 11-1 lead in their head-to-head record, that one defeat coming back in the US Open semi-finals in 2014 when Cilic went on to lift the trophy, and it seemed as though Federer had their latest contest on his racquet early on.
He raced into a 5-1 lead in the first set before closing it out in just 31 minutes, the crowd left stunned when the eighth seed stretched up to produce a remarkable drop-shot return winner.
Matters became trickier in the second set as Cilic went 3-0 ahead and only some precise serve-and-forehand work from Federer prevented the double break.
A curious moment occurred with Cilic leading 3-1 when Federer was issued a time violation when receiving serve at deuce. A bemused Federer spoke at length with the umpire before calling to Cilic, "Am I playing too slow?".
Although far from descending into a shouting match, the incident seemed to throw off Federer, who gifted the set to Cilic with two forehand errors and looked unsettled until he refocused with a ripped backhand winner in the opening game of the third.
Cilic forced the tie-break after Federer had spurned an easy chance for a double break, but a double fault from the world number 47 handed the initiative to his rival, who by this time looked imperious on serve and in control from the baseline.
An ace on his first set point wrapped up the breaker and another Cilic double fault saw him fall a break behind in the fourth. This time, Federer did not allow a sniff of a comeback.