Bayern Munich coach Pep Guardiola said Hamburg forced them to play at a higher intensity, in their DFB Pokal win.
The Bundesliga champions were 3-1 winners at Imtech Arena on Wednesday, with Robert Lewandowski's opener followed by further goals to David Alaba and Franck Ribery.
Pierre-Michel Lasogga struck a late consolation for the hosts.
Guardiola said Josef Zinnbauer's men brought out the best in Bayern, who advanced to a last-16 clash with second-tier Eintracht Braunschweig.
"Well, we were surprised with Hamburg. We knew we had to play fast and put pressure on them early on," he said.
"In the cup it's easy for you as a coach because you know: you lose, you're out.
"But from the very beginning we played very well and then got the first goal by Robert.
"Especially I am pleased with our performance in the second half."
Guardiola said his side's mentality to keep attacking with a 2-0 lead in the second half was credit to his players.
"Usually if you start the second half with a 2-0 lead, you play a little more neglectful - but we did very well," Guardiola said.
"So we are pleased, we are into the last 16.
"Until March next year we have this competition in our pocket.
"Now we regenerate and think about our next opponent: BVB [Borussia Dortmund]."comments