Playing in front of his home fans, the 34-year-old added to his triumph here three years ago to take his 13th ATP title.
Swiss great Federer, the second seed, was seeking a sixth win at this Wimbledon warm-up event having booked his seventh final ticket with a straight sets semi-final win over unseeded Russian Mikhail Youzhny.
Wildcard Haas, a former world number two, secured his place in the climax with defeat of compatriot Philipp Kohlschreiber.
‘One of my best’
After claiming the title Haas said: “This has been one of the best weeks of my career, but I reckon I won’t really appreciate what’s happened until this evening.
“If someone had said to me beforehand that I was going to beat Roger Federer, probably the best player of all time, I would have thought they were mad!”
Federer was magnanimous in defeat, saying: “Tommy has performed well throughout, I’m thrilled for him.”
This was Haas’s third career win over Federer after beating his better-fancied rival at Halle in the semi-finals in 2005 and 2006, against 10 defeats, the last in the semi-finals at Wimbledon in 2009.
Federer broke to lead 3-1 in the opening set but proceeded to lose three successive games to find himself trailing 4-3.
Haas went on to clinch the set on a winning serve in 50 minutes. In the second set Haas broke to lead 5-4 and serve for the match, winning out when Federer put a return long.