Eisleben was first mentioned in 997 as a market called Islebia, and in 1180 as a town. The counts of Mansfeld governed the area until the 18th century. During the Protestant Reformation, Count Hoyer VI of Mansfeld-Vorderort (1477–1540) remained loyal to his Catholic faith, but the family's Mittelort and Hinterort branches sided with Martin Luther, who ended up dying in Eisleben, as discussed below. The German Peasants' War devastated the area, about a century before the Thirty Years War. Count Albert VII of Mansfeld-Hinterort (1480–1560) signed the Protestant Augsburg Confession in 1530 and joined the Schmalkaldic League, a defensive confederation of Protestant princes which ultimately lost the Schmalkaldic War over Saxony to the forces of Emperor Charles V but gained Lutheranism's recognition as an official religion within the Holy Roman Empire, letting princes determine the official religion within their lands.