Moats and other historical water features had great importance for past societies. The functioning of these ecosystems can now only be retrieved through palaeoecological studies. Here we aimed to reconstruct the history of a stronghold’s moat during its period of operation. Our spatio-temporal approach allowed mapping of the habitat changes within a medieval moat for the first time. Using data from four cores of organic deposits taken within the moat system, we describe ecological states of the moat based on subfossil Chironomidae and Ceratopogonidae assemblages. We found that over half (57%) of the identified dipteran taxa were indicative of one of the following ecological states: limnetic conditions with or without periodic water inflow, or marshy conditions. Samples representing conditions unfavourable for aquatic insects were grouped in a separate cluster. Analyses revealed that the spatio-temporal distribution of midge assemblages depended mostly on depth differences and freshwater supply from an artificial channel. Paludification and terrestrialization did not happen simultaneously across the moat system, being greatly influenced by human activity. The results presented here demonstrate the importance of a multi-aspect approach in environmental archaeology, focusing not only on the human environment, but also on the complex ecology of the past ecosystems.