What had started as a rout, with Federer winning the first set in just 24 minutes, became much more complex, in part because of Federer’s anxiety and in part because Cilic adjusted to the indoor conditions after playing and practicing outdoors all tournament.

But Cilic was ultimately too inconsistent and not quite opportunistic enough while Federer, using his backhand chip to fine effect, was often able to put the tall Croatian in body positions and zones of the court where he was forced to be subtle instead of forceful.

Still, it was close, and with the match on the line, Federer fought off two break points on his serve in the first game of the fifth set and then broke Cilic in the next game. He challenged a second serve at 30-30 that turned out to be a double fault, then hit a deep return on the next point that Cilic failed to handle.

Federer held serve to go up by 3-0 in the next tense game and then accelerated to the finish line, one he has crossed more than any man at the major championships that define careers, even more so now than in Rosewall and Laver’s era.

Neither Rosewall nor Laver played a Grand Slam final under a closed roof, and though it was not raining on Sunday, temperatures in Melbourne surged again, hitting 103 degrees Fahrenheit (39 degrees Celsius) in the late afternoon.

Though the final was to begin at 7:30 p.m., when the weather was slightly cooler, the organizers determined one hour before the match that the combination of high temperatures and humidity called for them to put in effect their extreme-heat policy and play the final indoors.

“I was surprised to hear they had the heat rule in place for a night match,” Federer said. “I never heard that before. When I arrived to the courts, I was totally ready to play outdoors.”