It is a further sign of the decline of the 33-year-old, who was also beaten in the third round of the Australian Open earlier this year by Italy's Andreas Seppi.
Federer's last grand slam title was almost three years ago when he captured his seventh Wimbledon crown in 2012.
Wawrinka broke decisively in the first set and then twice more in the second. There were no breaks in a tighter third set, but Wawrinka won it on his second match point in the tiebreak.
"We know Stan can do this and it's nice for him and important for him to string it together and do well. I thought he played really great tennis today," said a diplomatic Federer.
"It was tough so it's all the more impressive the way Stan was able to play."
Wawrinka is now through to the semi-finals of the French Open for the first time.
"Today was my best match on clay and it's an incredible moment for me. The conditions were difficult with a lot of wind but I believed in my game and it was a really incredible match from me," he said.
The 2014 Australian Open champion's run in Paris comes after he beat Rafael Nadal in Rome recently before losing to Federer in the semi-finals.
"I'm playing good tennis and I'm really pleased to be in the Paris semi-finals for the first time," he added.
The quarter-final between Nishikori and Tsonga on the main Court Philippe Chatrier lasted three and three quarter hours as Tsonga raced into a two-set lead before pegged back and forced all the way to a decider.
Tsonga took the first set and then had four set points on Nishikori's serve at 5-1 in the second.
However, last year's US Open runner-up fended them off to keep the set alive and the match was then delayed for more than half an hour when a metal sheet from a giant video screen was blown off in high winds, crashing into spectators and leaving three with minor injuries.
Although Tsonga returned to serve successfully for the second set, the pause clearly affected him and Nishikori fought back to square the match.
But Tsonga then broke decisively to lead 3-1 and took the decider 6-3 to roars of delight from the partisan crowd.
"It was tough. I started really well and then there was this little incident. I heard there were no serious injuries so I'm happy about that. I served very, very well in the fifth set and managed to turn the situation back in my favour," said Tsonga.
The standout quarter-final on Wednesday will see reigning champion Rafael Nadal, seeded six, put his dominance of the clay-court Grand Slam on the line against world number one Novak Djokovic.
The winner of that will take on the winner of the other last-eight match between third seed Andy Murray and seventh seed David Ferrer, the runner-up in 2013.
-AAP