Defending champion Switzerland will qualify for Saturday’s final if it beats Greece on Thursday. The United States, which lost to Greece on Monday, can’t now advance.
The much-hyped contest lived up to the billing immediately with Federer almost running down Williams’ smash into the open court. Williams and Federer both served well against each other, but Federer’s sublime touch at the net proved decisive.
Williams grabbed at her right shoulder on several occasions late in the second set but played the match out.
Earlier, Federer beat Tiafoe 6-4, 6-1 in the men’s singles before Williams leveled the tie with a comeback 4-6, 6-4, 6-3 victory over Bencic.