Contemporary historiography is developing new and sophisticated analytical tools for the study of war, but these innovations are hardly ever applied to mediaeval conflicts. This article aims to examine the importance of cultural flexibility of military commanders in the age of the communes. It will take into consideration the offensive launched by Frederick II of Hohenstaufen against Milan in autumn 1239 and the countermeasures put into action by the Milanese army. The defenders, indeed, by astutely exploiting land and field fortifications, were able to prevent the invasion and pillaging of their territory, although they numbered far fewer than the Imperial army. The success was doubtlessly due to the ability of the civic ruling class to rise to the "cognitive challenge of war". They elaborated innovative tactics allowing the Milanese forces to effectively hold the field, even though they were still smarting under the devastating defeat of Cortenuova of two years earlier.
Keywords: Medieval war; emperor Fredrick II; leadership; tactics.