 The Protestant Reformation was introduced in Weimar in 1525; Martin Luther stayed several times in the city.As the Ernestines lost the Schmalkaldic War in 1547, their capital Wittenberg went also to the Albertines, so that they needed a new residence.As the ruler returned from captivity, Weimar became his residence in 1552 and remained as such until the end of the monarchy in 1918.