The Swiss pair won the mixed doubles clash with a packed stadium in Perth enjoying every moment of Federer and Serena going head-to-head for the first time.
Williams held up her end, dominant on serve throughout, but Frances Tiafoe was broken in the first set before Federer served it out in the second set tie break to seal the tie.
The result meant Switzerland beat the USA 2-1 overall, with Williams having beaten Bencic 4-6 6-4 6-3 and Federer easily seeing off Tiafoe 6-4 6-1 in their earlier singles clashes.
While the focus was on the two icons of the sport, the most entertaining exchange came early in the second set with Federer and Tiafoe both tagging each other.More news: Trump Just Sent an Urgent Message About the Wall
"I'm happy in all aspects of my game that things were working - foot work, offensive play, serve, return - it was all there".
"I admire everything she has done both on and off the court", Federer said. In his press conference at the Hopman cup, Roger Federer spoke about his experiences of playing against, and with, quality women tennis players.
The match will be the first time the two 37-year-olds, who have with 43 Grand Slam singles titles between them, face each other.
"I have been looking forward to it", she told The New York Times.
Williams described Federer as the greatest of all time and said his serve was underrated.
Switzerland will defend its unbeaten record against Greece in its final round robin match Wednesday with the United States taking on Britain. "I was like, 'Oh, my God, this is so cool.' So it's just something that, as a player, is something that you would dream of, to play Roger Federer". "I knew I could play better". Williams then overcame a case of the first-set wobbles to post a 4-6, 6-4, 6-3 success over Belinda Bencic, levelling the tie.