TORONTO (AP) -- Roger Federer advanced to the semifinals of the Rogers Cup with a 6-3, 5-7, 7-6 (5) victory over Tomas Berdych on Friday night.
Federer had lost to the No. 7-ranked Czech twice this season, most notably in the quarterfinals at Wimbledon.
"It's good to stop him and it's good for my confidence,'' Federer said. "I tried to take out a few things from Wimbledon, but out there (on the court) I was thinking of the Miami match. It played out similar except this time I made it.''
Federer will take on the No. 2-ranked Novak Djokovic of Serbia on Saturday in one semifinal. Djokovic ousted French challenger Jeremy Chardy 6-2, 6-3 in 72 minutes.
"He's a big champion and he showed (today) why he's one of the best,'' Djokovic said about Federer. "It's going to be a tough one, but in the semifinals you never know what's going to happen.''
With No. 1 Rafael Nadal and No. 4 Andy Murray also winning their quarterfinal matches Friday, it marks the first time since last August in Cincinnati that the top-four ranked players in the world - the same foursome but with different rankings - have all advanced to the semifinals of a tournament.
Federer broke serve in the first set to take a 4-2 lead and then dominated the next game with four straight points to push his advantage.
Berdych fought back to take the next game with powerful serves, but Federer used his imposing forehand shots from the baseline to take the opening set.
Down 6-5 and holding serve in the second, Federer committed a rare double fault and two unforced errors, leading Berdych to the pivotal break point where he made no mistake.
"It was one of those matches that felt like it was going to slip away again like the beginning of the season,'' Federer said. "That I was able to turn it around is huge at this point.''
Federer looked to be in trouble again in the third set when Berdych broke his serve to move ahead 3-1. But Berdych wasn't able to convert his chances on a 5-2 lead and Federer rallied to force the tiebreaker and thrill the crowd.
"The crowd was absolutely amazing,'' Federer said. "You rarely get those kind of atmospheres ... It's nice to get the support.''
"It's all right ... I'm happy that so many people just come to see, and they were enjoying, so just let them enjoy,'' Berdych said.
Nadal got a stiff test as he was pushed to a third set in a 3-6, 6-3, 6-4 quarterfinal victory over Philipp Kohlschreiber.
Nadal, who won this event in 2005 and 2008, was broken in his first service game and went on to lose the opening set. He used his punishing baseline game to bounce back and advance to the semifinals.
With Kohlschreiber serving at 3-3 in the deciding set, Nadal picked up four straight points for the break. They held serve after that with Nadal completing the win over the 37th-ranked German.
"Every match is tough and he's a good player, he's difficult to beat,'' Nadal said. "Today I started terrible in the beginning ... It's a good victory for me because I finished the match playing better.''
Kohlschreiber and Nadal both tried to wear the other down with a punishing pace from the back of the court. The German seemed to have trouble with his backhand in the third set, leading to several unforced errors.
Kohlschreiber said the Spaniard raised his game after the opening set.
"He played very aggressive from the baseline and pushed me back,'' Kohlschreiber said. "It was tough and there was a lot of pressure during the games when I didn't serve so well. He improved so much.''
Nadal will play defending champion Murray, who was dominant in a 6-2, 6-2 win over David Nalbandian of Argentina.
"He's playing well and it will be very difficult (on Saturday),'' Nadal said. "Playing against him is always a challenge. I have to improve my level (of play).''
The fourth-seeded Murray needed just 69 minutes to snap Nalbandian's 11-match winning streak.
"It was one of the best matches I've played this year probably,'' Murray said. "I was expecting it to be a very tough match and it wasn't. You know when you're out there, you're not really thinking whether it's comfortable ... you're not thinking about how easy the scoreline is or not, because he has been over the last few years one of the best at coming back from tough situations.
"So the scoreline would suggest that it was very easy. But if you look in the first set especially, a lot of close games, a lot of 30-all points, a lot of deuce points and long games. I just managed to hang on.''
Nalbandian, who was victorious at last week's Legg Mason Tennis Classic in Washington, gave credit to Murray but admitted that playing 10 matches in 14 days had taken its toll.
"I feel a little tired for all the weeks, for last week and this one, and I didn't get a rest,'' he said. "But I'm pretty happy the way that I tried to play. In a few games I was close, but I made some easy mistakes.
"I have to keep going, keep working, and I know I have a lot of tournaments from here until the end of the year. So I have to keep going in this way.''
Kohlschreiber lost his doubles match on Friday. He and France's Gael Monfils fell to second-seeded Americans Mike and Bob Bryan 6-7 (2), 2-6.
Note: It was the first time Nadal has dropped a set in the tournament. ... Nadal defeated Murray 7-6 (2), 6-3 in the semifinals when they last played here in 2008.