Roger Federer sputters in Germany against Tommy Haas. Getty Images

Roger Federer's return to tennis after a two-month break didn't go as planned. The No. 2 player in the world suffered the biggest upset loss of his career on Wednesday, falling to world No. 302 Tommy Haas at the Mercedes Open in Germany.

It's the first time Federer, 35, has lost to a player ranked so low since 1999, and the only time that he's been ranked so high and lost to a player so far down. The 2-6 7-6 6-4 defeat marked his first opening round loss on grass in 15 years. All-in-all, it was a perfect storm of struggle for Federer, whose reappearance was highly anticipated.

Federer won the first set of the match in decisive fashion, a 6-2 rout. After breaking early in the second set, Federer seemed ready to put the match into cruise control. Unfortunately, it seemed that he went into neutral instead, meandering about the court and seeming uninterested in the match around him. Haas, 39, broke back, and after that he battled through two grueling sets to ultimately hand Federer the loss in his return to the court. Federer, of course, skipped the clay schedule, opting out of the French Open which was won (with relative ease) by Rafael Nadal.

Haas has dealt with a great deal of adversity to get this point. His ranking is largely due to the low amount of matches that he's played in the past two years, and he's had several surgeries. He has defeated champions in the past, and he was playing on his proverbial "home court" in Stuttgart. He was a world No. 2 in the past and hovered around the top five for a large portion of his career. Federer and Haas are good friends off the court, and although Federer seemed stunned after the match, he congratulated Haas. Despite the difficult loss, Federer will likely be back. Whether or not he was shaking off rust from his hiatus remains to be seen.

All of his past success aside, even Haas seemed in awe of the win. "I've even shocked myself a bit," he said after the match. "I'm a bit speechless, it's hard to put into words." Haas is 4-13 against Federer in his career, but this is the first time he's beaten him since 2012. The loss comes a mere six months after Federer won the Australian Open in January. Haas saved nine of 12 break points and converted two of three of his own, which culminated to just enough to hand Federer his second loss of the season. It's a fantastic win for Haas, who is playing his final year before retirement. He'll certainly hope to carry this momentum the Stuttgart Open.

*The Associated Press contributed to this story