It's the second consecutive week that Djokovic has struggled, having also lost to Grigor Dimitrov in the second round of the Madrid Open, where he was 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 starting in less than 10 days on May 26.
''I'm fine. I just lost my rhythm. ... I feel good on the court,'' Djokovic said. ''I have some more time to prepare.''
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.''
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.
''I lost the concentration,'' Djokovic said. ''I started playing more defensively. I played a bad game at 5-3 and the match turned around. He started playing more confidently, stepping into the court and taking advantage of his opportunities.''
In the semifinals, Berdych will face either six-time Rome champion Rafael Nadal or fourth-seeded David Ferrer, who were up next on center court.
Also at the Foro Italico, top-ranked Serena Williams rolled past Spanish opponent Carla Suarez Navarro 6-2, 6-0 to extend her winning streak to a career-best 22 matches.
Williams had twice won 21 in a row before, although both of those streaks 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 streak in the Open Era at 74 matches in 1984.
In the other half of the women's draw, two-time defending champion Maria Sharapova withdrew before her quarterfinal against seventh-seeded Sara Errani due to illness.
In other men's play, 36th-ranked Benoit Paire of France routed Marcel Granollers of Spain 6-1, 6-0 to reach his first Masters series semifinal. He'll next face either 17-time Grand Slam winner Roger Federer or rising Polish player Jerzy Janowicz, who were playing a night match.
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, which set up easy volleys.
Djokovic had trouble returning Berdych's first serve and also complained about the court's surface early on.
As overcast skies gave way to sunshine, the court dried out, favoring Berdych's power game.
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 vs. a top-ranked player in 20 attempts, with all three previous wins coming over 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.''
(For more sports news and updates, follow Ahram Online Sports on Twitter at @AO Sports and on Facebook at AhramOnlineSports)