After losing to Guillermo Canas twice and Rafael Nadal in his previous three tournaments, Federer was defeated by an Italian wild card on Thursday.
Filippo Volandri beat the top-ranked Swiss 6-2, 6-4 in the third round of the Rome Masters, extending Federer's title drought to four tournaments.
It's the worst stretch of Federer's career since ascending to No. 1 in February 2004.
"I don't know what's wrong. I have to analyze it myself," Federer said. "I just couldn't get my teeth into the match at all."
Rome is a key clay-court warmup for the French Open, which begins May 27, and Roland Garros is the only Grand Slam that Federer hasn't won.
"(I need to) get back on the practice courts instead of the match courts," Federer said.
Two-time defending French Open champion Rafael Nadal extended his clay-court winning streak to 74 matches with a 6-2, 6-2 win over 15th-seeded Mikhail Youzhny.
Youzhny had beaten Nadal in their past two meetings - both on hard courts.
Nadal was examined by doctors Thursday for dizziness but appeared untroubled in his night match against Youzhny.
Nadal is trying to become the first player to win the Rome tournament in three consecutive years. He beat Federer in a fifth-set tiebreaker in last year's final.
In the quarterfinals, Nadal will face fifth-seeded Novak Djokovic, who rallied in the second set to beat last year's Australian Open runner-up Marcos Baghdatis 6-2, 7-5.
Third-ranked Andy Roddick's run also ended Thursday, losing to Juan Ignacio Chela 6-0, 6-4. Fourth-seeded Nikolay Davydenko avoided another upset by rallying to beat Potito Starace 4-6, 6-2, 7-5.
Federer dropped his serve twice in the first three games and quickly lost control of the first set. In the second set, Volandri broke to take a 2-1 lead when Federer made four errors.
"On clay you don't get many free points if you don't serve well, and I was serving horrendous in the beginning," said Federer, whose first-serve rate was 44 percent.
Volandri put 74 percent of his first serves in play.
"I served really well, with a lot of spin that made the ball bounce real high, and the strategy worked," Volandri said.
Volandri became the first Italian to beat a No. 1-ranked player since Gianluca Pozzi defeated Andre Agassi seven years ago.
"This is worth more," Volandri said. "I think Federer is the best player of all time."
Federer often missed routine baseline shots and his body language conveyed little will to compete. He hit only two winners with his forehand, and committed 44 unforced errors.
Federer's ability is usually enough - even on bad days.
"It happens a lot, but sometimes I get through them," he said.
Federer arrived in Rome more than a week before the tournament to intensify his clay-court training.
"I was the first player to arrive. My preparation was perfect," Federer said. "But let's not forget that Filippo played well today. Give the guy credit."