TORONTO (AP) -- Jo-Wilfried Tsonga reached the Rogers Cup semifinals with another upset victory, and Roger Federer was extended to three sets for the second straight night.

Tsonga beat eighth-seeded Andy Murray 7-6 (5), 4-6, 6-4 on Friday in the hard-court event. On Thursday, the 13th-seeded Frenchman knocked off top-ranked Novak Djokovic 6-2, 6-2.

''I don't have a lot of confidence behind me,'' Tsonga said. ''I try to be consistent in my work, and I'm sure it will give me some rewards. This week is kind of rewards for me, you know, to play like this, to beat two guys in the top 10. It's good, and I hope it will continue.''

The second-seeded Federer beat fifth-seeded David Ferrer 6-3, 4-6, 6-3 in the late match. On Thursday night, Federer edged Marin Cilic 7-6 (5), 6-7 (3), 6-4.

Federer will play Feliciano Lopez, a 6-4, 6-7 (5), 6-3 winner over sixth-seeded Milos Raonic of Canada.

In the other quarterfinal, seventh-seeded Grigor Dimitrov beat Kevin Anderson 5-7, 7-5, 7-6 (6).

Murray reached the quarterfinals by walkover when Richard Gasquet withdrew.

''I thought it was a high-level match with a few games by both of us in the second and third sets that were a bit scrappy,'' Murray said.