Roger Federer squandered three match points before suffering a shock 5-7, 7-5, 7-6 defeat at the hands of Cypriot Marcos Baghdatis at the Indian Wells ATP tournament on Tuesday.
The Swiss world number one, who had beaten the Cypriot in all six of their previous meetings, lost the tiebreak 7-4 and the third-round match when he failed to return his opponent's powerful first serve.
Federer, a three-time champion at Indian Wells, held two match points late in the second set and another in the 12th game of the third but wasted all of them through unforced errors.
"Seven is my lucky number," a jubilant Baghdatis said in a courtside interview after claiming victory in two hours, 22 minutes.
"I don't know what to say. I'm very happy. It's an amazing win for me," he explained.
The 27th-ranked Baghdatis will next meet Spaniard Tommy Robredo, who beat Israel's Dudi Sela 6-3, 6-0 earlier in the day.
"I used up too many chances," Federer told reporters, having lost when holding at least one match point for the first time since his defeat by Rafael Nadal in the 2006 Rome final.
"Comes back and haunts you. But he hung in there, obviously, otherwise he wouldn't be there. That was the result," he added.
Federer appeared to have the match under control when he broke Baghdatis in the 12th game to take the opening set in 45 minutes.
The second went with serve until Federer, leading 5-4, wasted two match points after going 15-40 up on his opponent's serve.
The 16-times grand slam champion hit a forehand long and then watched as a backhand floated beyond the baseline for Baghdatis to get to deuce before holding for 5-5.
The Cypriot, who reached his first grand slam final at the 2006 Australian Open where his run was ended by Federer, broke the Swiss in the next game and then held again to level the match.
Fededer regained control when he broke Baghdatis in the fourth game of the final set but the Cypriot broke back in the seventh when the Swiss netted a forehand.
Although Federer earned a third match point in the 12th after Baghdatis dumped a forehand volley into the net, he failed to convert when going for a backhand winner down the line.
The Cypriot, who entertained the stadium court crowd all night with his deft mix of intelligent lobs and bold drop shots, held serve when a mistimed Federer backhand sailed wide and went on to dominate the tiebreak.
"It wasn't the worst match, you know," Federer said. "Conditions are quick, it's tough to return, but I did many good things tonight but also many bad things.
"It's just a question of not letting that happen too often. I could be sitting here an hour earlier and saying how comfortably I won the match in straight sets not playing great, but moving forward.
"It's always a very fine line. That's not why I don't like to now beat myself up too much after a loss like this."