Three set points were wasted by the German but Federer double faulted when defending the fourth - having previously wasted his only match point.
"Playing Roger is always very special, especially on grass, especially here in Germany", he said.
Federer saved four set points and wasted a match point as the German forced a third set where he broke his opponent early on. Roger Federer, bearing a new haircut and the swollen expectations of fans spoiled by his season to date, was shocked by world No. 302 Tommy Haas in the second round of the Stuttgart Open, a tournament with a draw so soft he could have started clearing out shelf space for the title before it even started.
With another victory Haas, the lowest-ranked player to beat Federer since world number 407 Bjoern Phau in 1999, will become the oldest player to reach a tour semifinal since 40-year-old Jimmy Connors in 1993 in San Francisco.
Federer will be looking to claim his fourth title of the year at the Mercedes Cup and his first at Stuttgart, but his main priority will be to use this tournament as a warm-up for the rest of the grass and hard court season.
But the 35-year-old showed noticeable signs of rust in his first game back, struggling for consistency with his ground strokes against an inspired Haas.
It's Federer's worst loss, in terms of rankings, since he lost in Washington, a week after his 18th birthday, to No. 407 Bjorn Phau. Federer and Haas are good friends off the court, and although Federer seemed stunned after the match, he congratulated Haas. It was just the second loss of Federer's 19-2 season, the other being an upset by world No. 116 Eugene "Donkey" Donskoy in Dubai.
Federer was once again expected to put his foot on the accelerator but the push didn't materialise as Haas completed the win. "For me it's about getting back to winning ways, where I left off in Miami", he said.
The Rafa-Roger rivalry has been renewed this year and it's Federer who has the upper hand, winning all three of their high profile encounters, including the Melbourne and Miami finals. "Playing great tennis, playing in front of my family and my daughter that's really what it's all about for me now. I'm happy I was able to do it one more time in Stuttgart".