5-7, 6-1 to cement his place in the last four at the O2 Arena in London.
"It was a good battle and I always enjoy myself at this handsome arena", said Federer, who has now reached the semi-finals 14 times. "I think if I do the right things and I play the right tennis, I can give myself a chance to play on the weekend of any tournament".
"Thank you for making it such a special night".
"It is frustrating, absolutely, at the beginning of the third set I played well", Cilic said.
"It's been a tough group so to be through in two matches is great".
Both players could ill afford another defeat after losing their first matches at the O2 Arena and there was a sense of deja vu for Cilic, who led Alexander Zverev 3-1 in the final set of his opening contest before being consigned to defeat.
But Zverev went to pieces in the tie-break, only to fight back from 2-0 down in the second, capitalising on a noticeable Federer dip including five consecutive missed serves.
After those two games, the match zipped along at a rate of knots with barely 35 minutes having passed before Zverev was serving to try to force a tie-break.
Zverev has been touted as the leader of a pack of young players hungry to oust the creaking old guard but Federer, who has suffered only four defeats all year, shows no sign of slipping.
"It's been an interesting morning so far", said the American. "I play a different style and there's always a lot going on, I don't even know what I'm going to do sometimes, it keeps it fun". It's an wonderful atmosphere here and I love playing in London and in front of the fans here.
The top two players from each of the two groups of four progress to the semi-finals.
Nadal, who certainly enjoys playing on clay, had earlier vented his frustration about the hard-court surface at the ATP Finals and suggested that it would be better if the season-ending event at least occasionally took place on his preferred surface.