The top seed Swiss was joined on the sidelines by holder Rafael Nadal, whose return after more than two months, was cut short by sixth seed Juan Del Potro of Argentina 7-6(5), 6-1.
Nadal, who never rated his chances for the trophy in his first event back since losing May 31 in the French Open, is now likely to lose his number two ranking to Andy Murray if the Scot reaches the final.
Del Potro, winner of the Washington title August 9, is to play Saturday against fifth seed Andy Roddick, who beat Novak Djokovic 6-4, 7-6(4).
Federer's upset loss against Tsonga ended a 21-match winning streak for the world number one Swiss, who had won on clay in Madrid and Paris and lifted a sixth Wimbledon title five weeks ago over Roddick.
"Of course, I hope I can get through these matches, especially being up a double break," Federer said. "It's obviously disappointing, but that's what Jo does. He doesn't make a return for three hours, and then he puts in a few, and then all of a sudden, he gets back into the match.
"I never should have allowed it, but it did happen so it's a pity."
Tsonga, treated in the third set for an apparent elbow injury, hung tough as Federer twice served for victory.
The 2008 Australian Open finalist then fought his way back into contention, forcing Federer to save three match points in the 12th game to enforce a tiebreaker.
The decider went Tsonga's way to lift the seventh seed into a semi-final with Murray.
Tsonga said he groped his way out of what had looked to be an impossible situation. "5-1 down and Roger playing well. I had no solution," the Frenchman said.
"I just said to myself, 'You have to put the ball one more time than him' - and I did it. It was just amazing to change this match."
Added Federer, now heading to next week's event in Cincinnati with his wife and two newborn girls in tow: "It was great to get some matches in, but my goal wasn't really just to play matches here and sort of show up and do press conferences. The point of the whole trip here was trying to do well and trying to win the tournament."
Murray had to overcome a battle with the elements to stay on track for his best career ranking after a 6-2, 6-4 quarter-final defeat of Russian Nikolay Davydenko.