TORONTO: Third-seeded Stanislas Wawrinka, the Australian Open champion, was knocked out of the Toronto Masters in the third round on Thursday, losing in straight sets to Kevin Anderson of South Africa.

Anderson won 7-6 (10/8), 7-5 and will face either Grigor Dimitrov or Tommy Robredo for a place in the semifinals.

Wednesday, top-ranked Novak Djokovic edged Gael Monfils 6-2, 6-7 (4), 7-6 (2) in the second round.

After a lopsided tiebreaker, Djokovic fist-pumped and yelled at the end of the match that lasted 2 hours, 40 minutes.

Monfils pulled out all the stops by hitting a between-the-legs shot and throwing his racket to hit the ball, and each player tried to ignite the crowd to get louder.

“He’s probably the only guy in the world, tennis player, that I would pay a ticket to watch the match,” Djokovic said of Monfils. “He’s really fun to watch but not so much fun to play against. ... He loves jumping around, sliding, he’s very unpredictable. You don’t know what his next move is, so that’s why he’s so interesting.”

Monfils didn’t endear himself to fans by arguing with chair umpire Gerry Armstrong after receiving a time violation, even as they were captivated by his dazzling play on the court. As a result, Djokovic had support behind him as he came back from a 3-1 deficit in the third set.

“In a way it was fun, of course, and entertaining to be part of this match,” said Djokovic, who will face Jo-Wilfried Tsonga in the next round. “I enjoyed it.”

By avoiding what would’ve been the biggest upset of the tournament thus far, Djokovic kept alive the possibility of facing eighth-seeded Andy Murray in the quarterfinals.

Murray had little trouble winning his opener, defeating 19-year-old Australian Nick Kyrgios 6-2, 6-2 in the first match of the day on center court.

Milos Raonic had his serve going amid some erratic shots as he came back to beat American Jack Sock 4-6, 7-6 (2), 7-6 (4) on center court.

Fans chanted “Let’s go Milos! Let’s go Milos!” between points, cheering on the last Canadian left in the field. On Tuesday, all four men who played singles were eliminated.

Raonic stunted that momentum with 15 aces that helped offset some struggles to return Sock’s serve. He won 79 percent of his first-serve points but was broken in the first set.

In the second set, Raonic held serve before blowing out Sock in the tiebreaker. The Canadian needed another tiebreak to finish off the match.

Raonic will face Julien Benneteau of France on Thursday. Benneteau upset 11th-seeded Ernests Gulbis on Wednesday after beating Lleyton Hewitt in the first round.

Jo-Wilfried Tsonga beat fellow Frenchman Jeremy Chardy 7-6 (4), 6-4 to set up a match with Djokovic.