In the late Middle Ages Lowicz was the seat of a castellany. Located on the border between the Kingdom of Poland and the Duchy of Masovia, it remained under firm control of the Gniezno Archbishops. In the mid-14th century Lowicz, together with 111 adjacent villages, was the biggest church property in Poland. On May 17, 1359, Siemowit III, Duke of Masovia confirmed the ownership of Lowicz by the Gniezno Primates. Nevertheless, the dukes of Masovia on several occasions tried to place Lowicz under their authority, which resulted in conflicts with Polish kings, who supported the Archbishops. On April 8, 1382, Siemowit IV, Duke of Masovia besieged Łowicz, and such conflicts occasionally returned until the incorporation of Mazovia into Poland.