ROME -- Novak Djokovic can't seem to find any consistency on clay courts. And with the French Open less than 10 days away, he will enter Roland Garros on the back of two early defeats.

The top-ranked Serb wasted a chance to serve out the match and was beaten 2-6, 7-5, 6-4 by sixth-seeded Tomas Berdych in the Italian Open quarterfinals Friday.

In the semifinals, Berdych will face six-time Rome champion Rafael Nadal, who defeated fellow Spaniard David Ferrer 6-4, 4-6, 6-2. While he struggled at times, Nadal appeared sharper than in his three-set win over Latvian qualifier Ernests Gulbis a day earlier.

In the other half of the draw, Roger Federer overcame an early break in the second set to edge rising Polish player Jerzy Janowicz 6-4, 7-6 (2) in a night match at the Foro Italico.

Federer will play Benoit Paire, the 36th-ranked Frenchman who routed Marcel Granollers of Spain 6-1, 6-0 to reach his first Masters series semifinal.

In the women's tournament, top-ranked Serena Williams rolled past Spanish opponent Carla Suarez Navarro 6-2, 6-0 to extend her winning run to a career-best 22 matches. Williams will face Romanian qualifier Simona Halep, who rallied past two-time Rome champion Jelena Jankovic 4-6, 6-0, 7-5.

Meanwhile, two-time defending champion Maria Sharapova withdrew before her quarterfinal against seventh-seeded Sara Errani due to illness. Errani, the first Italian semifinalist in this tournament since Raffaella Reggi won the 1985 event in Taranto, will face third-seeded Victoria Azarenka, who held off ninth-seeded Sam Stosur 6-4, 1-6, 6-3.

It's the second consecutive week that Djokovic has struggled, having also lost to Grigor Dimitrov in the second round of the Madrid Open after being bothered by a right ankle injury.

Djokovic said he had been playing pain free this week.

Still, he will need to get his game in shape in a hurry with the French Open, the year's second Grand Slam, starting May 26.

"I know I can play well on clay and so I shouldn't allow myself to have these drops, and let's hope it won't happen for Roland Garros," Djokovic said about the only major he hasn't won. "I'm fine. I just lost my rhythm."

Djokovic served for the match at 5-3 in the second set, but Berdych ripped a backhand winner that landed on the line on his first break point and won the final four games of the set.

"It's a very strange situation," Djokovic said. "I played very well and was two points from winning. Then the entire match changed and I was a different player."

It's the first time Berdych has reached the semifinals in eight appearances in Rome, having been eliminated four times in the quarters.

The tall Czech took control of the match with his big first serve, and by coming forward to angle shots into the corners to set up easy volleys.

Djokovic had trouble returning Berdych's first serve and also complained about the court's surface early on.

In the third set, Berdych went ahead with an early break and then shook off some nerves to close the match out on his fourth match point with a big serve out wide that Djokovic could barely get his racket on.

As overcast skies gave way to sunshine, the court dried out, favoring Berdych's power game.

"I lost the concentration," Djokovic said. "I started playing more defensively. ... He started playing more confidently, stepping into the court and taking advantage of his opportunities."

It was only Berdych's second win in 15 career meetings with Djokovic, with his only previous victory coming in the 2010 Wimbledon semifinals.

It was also only Berdych's fourth win versus a top-ranked player in 20 attempts, with all three previous wins coming against Federer.

"He has been for quite a few years just behind the top four," Djokovic said. "He's able to play big matches. He has proven that. So (he) is definitely a very dangerous player on any surface with a serve like that."

Djokovic was 148-4 when winning the first set since 2011, according to the ATP.

Williams had twice won 21 in a row before, although both of those runs came a decade ago, in 2002 and 2003.

"I've been pretty consistent, and pretty healthy -- knock on wood," Williams said. "I feel great -- never felt better."

Martina Navratilova established the longest women's win run in the Open Era at 74 matches in 1984.

Williams' only title here came in 2002, when she beat Justine Henin in the final. That was also the year she won her only French Open title. Last year in Paris, Williams lost in the opening round of a major for the first time, falling to 111th-ranked Virginie Razzano of France.

Sharapova said he was struggling with an illness she first contracted last week, when she was runner-up to Williams in Madrid, although she showed no problems Thursday as she beat 16th-seeded Sloane Stephens 6-2, 6-1.

"I was already a bit off in Madrid and played though it and it came back last night and I got sick again and it's not smart to compete again," said Sharapova, adding that she had a fever after beating Stephens. "Obviously, with the French Open coming up it is important to make smart decisions."