Thus in 1803, in accordance to this agreement, in the territorial rearrangements consequent on Napoleon's suppression of the ecclesiastical states and of many free cities of the Empire, Bavaria received the bishoprics of Würzburg, Bamberg, Augsburg and Freisingen, part of that of Passau, the territories of twelve abbeys, and seventeen cities and villages. The whole form a compact territory which more than compensated for the loss of her outlying provinces on the Rhine. Montgelas now aspired to raise Bavaria to the rank of a first-rate power and he pursued this object during the Napoleonic epoch with consummate skill, allowing fully for the preponderance of France — so long as it lasted — but never permitting Bavaria to sink, like so many of the states of the Confederation of the Rhine, into mere French dependency. In the war of 1805, in accordance with a treaty of alliance signed at Würzburg on 23 September, Bavarian troops, for the first time since the days of Charles VII, fought side by side with the French, and by the Treaty of Pressburg, signed on 26 December, the Principality of Eichstädt, the Margraviate of Burgau, the Lordship of Vorarlberg, the counties of Hohenems and Königsegg-Rothenfels, the lordships of Argen and Tettnang, and the city of Lindau with its territory was to be added to Bavaria. On the other hand, Würzburg, obtained in 1803, was to be ceded by Bavaria to the elector of Salzburg in exchange for Tirol. By the 1st article of the treaty, the emperor acknowledged the assumption by the elector of the title of king, as Maximilian I. The price which Maximilian had reluctantly to pay for this accession of dignity was the marriage of his daughter Augusta with Eugène de Beauharnais. On 15 March 1806 he ceded the Duchy of Berg to Napoleon.