Lenzburg was conquered by Bern in 1415, along with the western part of current Aargau, though Bern did not take away its city rights. In 1433, the city of Bern bought the castle and used it to govern the region from 1444 to 1798. A major fire devastated the town in 1491, sparing only fifteen houses. The Reformation was carried out simultaneously with the rest of the region in 1528, and the economy started to transform slowly from an agrarian to a more industrial one in the 16th century. In the 18th century Lenzburg developed into a centre for cotton trade and processing. An Indienne textile factory was founded in 1732.