 In the eleventh century Pagazzano already gravitated in the Milanese political and military orbit to find itself in 1300 in the possession of the Viscounts who built a castle here between 1450 and 1475.Pagazzano and specifically its castle were the object of interest in the age-old opposition between the Visconti-Sforza and the Serenissima (Republic of Venice), passing repeatedly from one state to another, without however improving the socio-economic conditions of the inhabitants of the village.The controversial issue related to the border between the two powers was defined with the construction of the Bergamasque ditch, a channel that also bordered the territory of Pagazzano, delimiting it to the east and relegating it definitively under the influence of Milan.