Siding with Albert IV, Duke of Bavaria-Munich, in the Landshut War of Succession of 1503-1505 led the city to gain substantial territory, resulting in lands of 25 sqmi , making it one of the largest Imperial cities.