Canada's Milos Raonic has been eliminated from the Shanghai Masters after losing 7-6 (2), 6-4 to Switzerland's Stanislas Wawrinka in the third round.

The 10th-ranked player from Thornhill, Ont., was coming off two straight final appearances, winning in Thailand before losing the final in Tokyo last week.

Meanwhile, Roger Federer's chances of qualifying for the ATP Tour Finals took a hit Thursday when he lost in three sets to Gael Monfils, the latest early round loss for the 17-time Grand Slam champion.

Monfils beat the former No. 1-ranked Federer 6-4, 6-7 (5), 6-3 in the third round.

Defending champion Novak Djokovic and top-ranked Rafael Nadal moved into the quarter-finals with straight-set wins.

Djokovic beat Italy's Fabio Fognini 6-3, 6-3, and Nadal rallied from 5-2 down in the second-set tiebreaker to down Argentina's Carlos Berlocq 6-1, 7-6 (5).

Two of the tournament's other top seeded players were ousted: No. 3 David Ferrer lost to Florian Mayer 6-4, 6-3, and No. 4 Tomas Berdych was upset by Nicolas Almagro 6-7 (6), 6-3, 7-6 (4).

Federer, who has slipped to No. 7 in the rankings, was playing for the first time since losing in the fourth round of the U.S. Open. He needed a strong showing in Shanghai to secure a berth in the elite season-ending ATP Tour Finals in London, a tournament he played every year since 2002.

Federer is currently seventh in the standings, with only a slight lead over several other players vying to get into the eight-man field in London. He plans to play in Basel and Paris in hopes of making it into the Nov. 4-11 tournament.

Federer remained upbeat despite the loss, and his subsequent defeat in doubles with Chinese partner Zhang Ze. He said the most important thing was not to worry about every setback.

"It's pretty simple: You just keep on working hard, make sure that you get back on winning ways, then you become confident again, sort of get there," Federer said.

Djokovic, who faces Monfils next, said although Federer's form has dropped this season, it would be a mistake to write him off.

"He's 17-time Grand Slam winner, one of the best players in the history of the game. If he says he's going to play better, work better, it's definitely worth listening if he says it that way," he said.

Jo-Wilfried Tsonga, Juan Martin del Potro and Stanislas Wawrinka also advanced to the quarterfinals, strengthening their bids to qualify for the ATP Finals.