Gallas' army had initially been sent to Jutland by Emperor Ferdinand III to aid Denmark in combating the Swedish invasion. When Rákóczy's army, in alliance with Sweden, had begun an offensive on Habsburg Hungary in February 1644, Ferdinand III felt it necessary to recall Gallas to Hugary's aid. The battle of Juterbog occured within this context.
Torstensson took advantage of the Imperial retreat by routing Gallas' forces through the most devastated possible areas, causing the vast majority of his men to die of starvation.
This episode was a key event not only in Denmark's exit from the Thirty Years' War, but also its decline in the face of a rising Sweden.
Gallas was dismissed shortly thereafter.