After Bayern boss Louis van Gaal was told last Monday that his contract will be terminated at the end of the season -- a year earlier than planned -- Bayern got back to winning ways in style after three straight defeats.
Bayern started strongly at Munich's Allianz Arena and hit the woodwork three times in the first half before Robben netted his first goal after 40 minutes.
He curled in a direct free-kick on 47 minutes and completed his hat-trick eight minutes later after French winger Franck Ribery tore through the Hamburg defence and squared to the Dutchman, who rifled home.
Not to be outdone, Ribery then scored his first goal since December when he outpaced the Hamburg defence and chipped home on 64 minutes.
Germany midfielder Thomas Mueller scored the fifth with 10 minutes remaining after a great pass from Turkey's Hamit Altintop split the Hamburg defence.
To complete the humiliation, Ribery teased the defence and then saw his low cross deflected in off the legs of Hamburg captain Heiko Westermann in the 85th minute.
The league's top side Dortmund were beaten for only the third time this season through a second-half goal from Hoffenheim striker Vedad Ibisevic.
With second-place Bayer Leverkusen at Mainz on Sunday, Dortmund keep their 12-point lead at the top, while defending champions Bayern are still 16 points off the pace despite their win in Munich.
Schalke, who booked their place in the Champions League quarter-finals in mid-week, beat Eintracht Frankfurt 2-1 to ease the pressure on coach Felix Magath after last week's reports he is set to be fired.
The Royal Blues' bosses have neither confirmed or denied the reports and there were plenty of banners in support of Magath at the Veltins Arena.
Spain's Raul earned his side a first-half penalty, which was netted by Jose Manuel Jurado, before Greek defender Georgios Tzavellas equalised in the second half.
Greek striker Angelos Charisteas scored the winner in the 84th minute -- 52 seconds after coming off the bench.
Mid-table Nuremberg picked up their sixth win in seven games with a 2-1 win at Wolfburg, which dropped Wolves into the relegation zone, while Kaiserslautern won 2-1 at home to Freiburg to escape the bottom three.
Werder Bremen, who are just two points above the drop zone, host bottom club Borussia Moenchengladbach on Saturday night.
Cologne picked up their sixth straight league win at home with a 4-0 victory over Hanover on Friday night.
Germany striker and Cologne captain Lukas Podolski got on the scoresheet, while Slovakian forward Milivoje Novakovic netted twice in the second half to give him 11 goals from 20 league games this season.