ROME -- Novak Djokovic is back on track after a right wrist injury sidelined him last week. And Serena Williams is cruising again, too, after being slowed by a left thigh problem.

The second-ranked Djokovic overcame a stiff challenge from David Ferrer before grinding out a 7-5, 4-6, 6-3 win Friday to reach the Italian Open semifinals.

Top-ranked Williams then rolled past Zhang Shuai of China 6-1, 6-3 to stay on course in her title defense.

Djokovic double-faulted on his first match point but then won a 38-shot rally before eventually closing it out in just over 2½ hours.

"It was definitely the most physical match I've had on clay this year," Djokovic said, adding that his wrist is reacting well. "I'm playing with no pain. As long as it stays like this I'll be happy."

Having sat out last week's Madrid Open, Djokovic will face eighth-seeded Milos Raonic for a spot in the final.

The big-serving Raonic held off Jeremy Chardy of France 6-3, 5-7, 6-2 on an overcast day with intermittent rain at the Foro Italico.

Djokovic is aiming for a third Rome title, having won the clay-court event in 2008 and 2011.

Also reaching the last four was Grigor Dimitrov, who celebrated his 23rd birthday with a win when 36-year-old Tommy Haas retired after losing the first set 6-2 due to a right shoulder injury -- spoiling a matchup between the youngest and oldest players in the top 20.

Dimitrov's semifinal opponent will be either seven-time Rome champion Rafael Nadal or Wimbledon title-holder Andy Murray, who were playing later in the last key warm-up event before the French Open starts in nine days.

"It's definitely one of the most memorable days of my life," Dimitrov said upon reaching his first Masters series semifinal. "I'm just a happy birthday boy today."

In women's play, Sara Errani took advantage of a supportive crowd to beat second-seeded Li Na 6-3, 4-6, 6-2 and reach the semifinals for the second consecutive year. She'll meet 2007 and 2008 Rome champion Jelena Jankovic, who eliminated third-seeded Agnieszka Radwanska 6-4, 6-4.

In the other half of the draw, 2008 French Open champion Ana Ivanovic beat 13th-seeded Carla Suarez Navarro 6-4, 3-6, 6-4 and will face Williams.

The 10th-seeded Errani is attempting to become the first Italian to win the tournament since Raffaella Reggi took the title 29 years ago in Taranto.

The last Italian man to win was Adriano Panatta back in 1976.

Li had won all six previous meetings with Errani but she was unusually inconsistent this time, committing 52 unforced errors to Errani's 21, and appeared rattled by a close call from the chair umpire early in the third set.

Errani celebrated by waving her arms to incite the crowd.

"I did well not to get carried away by the euphoria," Errani said. "It's difficult to describe how it felt at the end. The fans were incredible."