"I'm happy that I was able to play because I've had problems for some time now, already in Hamburg," Federer said. "But it didn't get worse during today's match."
Brands broke Federer to lead 4-2 in the opening set when he put away an overhead at the net. But the 26-year-old German closed the first set with two aces, among his 11 for the match. Federer immediately lost serve in the second set by netting a backhand volley and saved three break-point chances to avoid trailing 3-0.
Federer is to return next month at the Montreal Masters and then defend his Cincinnati Masters title before the U.S. Open begins Aug. 26.
Two other seeded players were ousted in the second round: Third-seeded Janko Tipsarevic of Serbia lost to Robin Haase of the Netherlands 6-2, 6-2; and eighth-seeded Roberto Bautista Agut of Spain retired with a back injury against Victor Hanescu of Romania while trailing 7-6 (2), 3-2.
Also, Marcel Granollers of Spain defeated Federico Delbonis of Argentina 6-2, 7-5.