In 1574, the surviving Mansfeld counts Hans Hoyer, Hans Georg, Hans Albrecht and Bruno concluded an agreement with the Elector of Saxony to repay the family's extensive debts, but some properties were forfeited by 1579 anyway. The Hinterort branches died out in 1666, but the Mansfeld-Vorderort line lasted until 1780, when it too became extinct and Eisleben came directly under the Electorate of Saxony. After the Napoleonic Wars ended, the Vienna Congress assigned Eisleben to the Kingdom of Prussia, which had long been allied with House of Welf which held the Duchy of Magdeburg, and after secularization in 1680 was administered by the Elector of Brandenburg.