MASON, Ohio -- Roger Federer could finally bask in some warm feelings during his rough summer. No surprise that they finally came at one of his favorite tournaments.

Up next, a favorite nemesis.

Federer overcome a tough start and emerged from his string of subpar showings since Wimbledon, beating Tommy Haas 1-6, 7-5, 6-3 on Thursday to advance to the quarterfinals at the Western & Southern Open.

He'll play fourth-seeded Rafael Nadal on Friday night, reprising one of tennis' greatest rivalries. Nadal leads the series 20-10, including a pair of wins over Federer this season.

"Always playing against Roger is a special feeling," Nadal said. "We have a great history behind us in our confrontations. So it's another quarterfinals. It's a special one because you're playing against a very special player."

Nadal beat Grigor Dimitrov 6-2, 5-7, 6-2 in a 2-hour evening match. Nadal has overcome an injured left knee that wiped out the end of last season and a stomach virus that affected him early this year, taking a career-best mark of 50-3 into the quarterfinals.

Federer is just glad to be playing. The fifth-seeded Swiss star has been struggling to get his game back in shape since he was upset at Wimbledon by a player ranked 116th in the world. He has switched rackets and been limited by a sore back.

Finally, his game started to come together Thursday at a tournament he's won an unprecedented five times, including last year.

"Overall, I'm looking at the big picture and just playing matches again," Federer said. "I want to make sure I'm moving well and feeling fine. A match like this gives me a lot."

While Federer took a step, No. 1 Novak Djokovic got one win closer to a little ATP history. He needed only 50 minutes to beat qualifier David Goffin, 6-2, 6-0 and reach the quarterfinals.

Djokovic has lost four finals in Cincinnati, the only Masters series event he has yet to win. A victory would make him the first player to win all nine Masters. He plays John Isner on Friday.

"I played four times finals, so it's been one of the tournaments where I've performed well," Djokovic said. "Never managed to make the final step, and hopefully this year I can do so.

"I have an extra motivation and an opportunity to make history in this tournament, so I'm very inspired to play well day after day."

Also reaching the quarterfinals were second-seeded Andy Murray, sixth-seeded Tomas Berdych, seventh-seeded Juan Martin del Potro and Russian qualifier Dmitry Tursunov, who upset third-seeded David Ferrer.

On the women's side, second-seeded Victoria Azarenka, fourth-seeded Agnieszka Radwanska, fifth-seeded Li Na, 10th-seeded Caroline Wozniacki, 12th-seeded Roberta Vinci, 14th-seeded Jelena Jankovic and unseeded Simona Halep advanced to the quarterfinals.

A few hours after her win, Radwanska withdrew from the tournament so she could attend her grandfather's funeral. Li, who won the tournament last year, automatically moved into the semifinals.

It appeared that Federer wasn't long for the tournament after a stunningly bad start against Haas. The 35-year-old Haas needed only 31 minutes to win the first set and was up 4-2 in the second before Federer took control.

"You know, being down 6-1, 3-1, you don't feel like Superman out there," Federer said. "You feel a bit slower, you feel a bit weaker, you feel a bit softer, whatever it is. I was trying to push myself. But at the end, as the match wore on, I felt better.

"That's always good news."

Federer was beaten in the second round at Wimbledon by Sergiy Stakhovsky, his earliest exit from a Grand Slam event since 2003. That ended Federer's streak of reaching the quarterfinals in 36 straight major tournaments.

The improbable upsets were just starting. He lost to players ranked 114th and 55th in the world in the next two tournaments, while he was experimenting with a larger racket and his back was bothering him.

He skipped Montreal last week to get ready for Cincinnati, hoping a good showing this week would get him ready for the U.S. Open.

"Every match gives me more info to tell me if I'm on the right path or not," he said. "But I'm a strong believer that I am on the right path right now, and I just need to make sure that mentally I stay cool about it.

"Today for a long time it wasn't looking good, but these are the kind of matches I need right now."

Tursunov pulled off the day's biggest upset, beating Ferrer 6-2, 6-4. The 44th-ranked Tursunov never lost his serve while reaching the quarterfinals for the first time in six appearances at the event.

On the women's side, Jankovic overcame a slow start and beat American Sloane Stephens 3-6, 7-5, 7-5. Stephens upset third-seeded Maria Sharapova in the second round, but struggled with her serve after she won the first set against Jankovic.

Azarenka advanced with a 6-3, 6-4 victory over No. 33 Magdalena Rybarikova. Azarenka withdrew from last week's Rogers Cup in Toronto with a lower back injury. She reached the quarterfinals for the first time in three appearances at the event.