Defending champions Switzerland sealed a 2-1 victory over six-times winners United States that left them bottom of Group B but the result mattered little to over 14,000 fans in Perth and millions around the world who had eagerly awaited the contest.
Federer and Williams, holders of a combined 43 singles Grand Slam crowns, won their singles matches to keep the mixed doubles clash alive and the deciding match lived up to the hype it had generated as both players left the court with big smiles.
The contest had been described by local media as the most anticipated clash involving men and women since 1973's "Battle of the Sexes" where Billie Jean King beat Bobby Riggs in an exhibition match.
While that meeting between 39-times major winner King and former men's world number one Riggs was a grudge match, there was only mutual respect between Federer and Williams, who posed for selfies before indulging autograph hunters.
"It was great fun. What a pleasure. What an honour. Thank you for making it possible," 20-times Grand Slam winner Federer, who is gearing up to defend his Australian Open title this month, said.
"I was nervous returning. People talk about her serve so much and I see why it is such a wonderful serve because you just can't read it."
Serena said the match, which was full of laughter and had an exhibition feel to it, was a "great experience" and one she hoped would not end as quickly as it did.
"I'm sorry it had to finish, I was just warming up. It was such fun, we grew up together. It was super cool. I wanted to take pictures and bring my baby out," the 23-times Grand Slam winner said.
"This guy is great, both off the court and on the court. I think his serve is super-underestimated. It's a killer serve, you can't read it. I watched him all the time and I never knew how amazing it was."
Playing in front of the highest single session attendance in the tournament's history, the team of Federer and Belinda Bencic beat Williams and Frances Tiafoe 4-2 4-3(3) to clinch the tie to top the group.
Earlier, Federer hardly broke sweat in his singles match against Tiafoe, taking his game up a notch at 4-4 in the first set to win 6-4 6-1.
Williams, who had powered past Greece's Maria Sakkari in straight sets on Monday, then fought back from a set down to seal a 4-6 6-4 6-3 win over Bencic to level the contest at 1-1.
Switzerland have two wins from two games ahead of Thursday's meeting with Greece, while U.S. take on Britain next.