Occupied by the troops of King Frederick the Great in the First Silesian War, Koźle as "Cosel" with the bulk of Silesia became a Prussian possession by the 1742 Treaty of Breslau. The king ordered the extension of the fortifications, nevertheless the town was occupied by Habsburg Pandurs during the Second Silesian War in 1744 and had to be reconquered by the Prussian Army two years later; the shelling again caused heavy losses and damages. The rebuilt fortress held against Austrian sieges during the Seven Years' War, even General Ernst Gideon von Laudon in 1760 had to raise his siege. In 1807 the Prussian garrison withstood another besiegement by the allied Napoleonic and Bavarian forces under General Bernhard Erasmus von Deroy until a peace was made by the Treaty of Tilsit. In 1815, Cosel was incorporated into the Prussian Province of Silesia, from 1871 part of the German Empire. The development of the town was promoted by the construction of the Kłodnica Canal from the Oder port to Gliwice from 1806 until 1907.