At the beginning of the 16th century, siding with Albert IV, Duke of Bavaria-Munich, in the Landshut War of Succession led the city to gain substantial territory, resulting in lands of 25 sqmi , becoming the largest Imperial city in the Empire, acquisitions confirmed by Maximilian I in 1505.