The Reformation was introduced in Gotha in 1524 and the castle was rebuilt as a larger fortress between 1530 and 1541. Gotha was already part of the Ernestine Wettins territory after the 1485 Treaty of Leipzig. However, the Ernestines' loss of power after the Schmalkaldic War in 1547, the Treaty of Erfurt in 1572, when the city became part of Saxe-Coburg, and the Thirty Years' War resulted in Gotha's decline. The local castle, "Grimmenstein", was razed by Imperial troops in 1572.