He was the second son of Johann Frederick I, Elector of Saxony, and Sibylle of Cleves. At the time of his birth, his father still carried the title Elector of Saxony, but he lost it in 1547 after his defeat and capture by the Emperor Charles V due to his support of the Protestant Reformation. Johann Frederick was released and forced to adopt the lesser title of duke of Saxony in an area substantially smaller than his former lands in Thuringia. In 1554, after the death of his father, Johann Wilhelm inherited the duchy of Saxony with his older brother, Johann Friedrich II, and his younger brother, Johann Friedrich III. The three brothers divided the duchy: Johann Friedrich II as head of the family took Eisenach and Coburg; Johann Wilhelm received Weimar; and Johann Friedrich III inherited Gotha. In 1565, however, when Johann Frederick III died without heirs, the two surviving brothers drew up a new treaty that divided his lands. The older brother retained his original lands and occupied Gotha, whereas Johann William retained his lands in Weimar. The partition plan also stipulated that the two brothers should exchange their regions among themselves every three years. This provision was never carried out, however. The political policies of Johann Friedrich II were directed towards recovering the lands and title of elector lost by his father in 1547. He did briefly recover the electorate during the period 1554–1556, but his involvement in political intrigues angered the Emperor Maximilian II. The Emperor finally imposed the Reichsacht on him, which made him the object of a Reichsexekution in which Johann Wilhelm participated. After a siege of his castle in Gotha, Johann Friedrich was finally defeated in 1566 and spent the rest of his life as an Imperial prisoner. His possessions were confiscated by the Emperor and handed over to Johann Wilhelm, who thereby became the only ruler of the entire duchy of Saxony. Johann Wilhelm soon fell into disfavor with the Emperor, however, when he entered the service of the King Charles IX of France as a general in his campaign against the Huguenots. This also alienated his Protestant subjects. Johann Wilhelm was a member of the House of Wettin, which had served as the protecting power of Protestantism in Germany since the time of Frederick the Wise, yet he allied himself with the Catholic King of France against the Protestants Huguenots. The Emperor played off the two surviving sons of Johann Friedrich II against Johann Wilhelm, and in 1572 the Division of Erfurt was concluded. The duchy of Saxony was divided into three parts. The older of the two sons of Johann Friedrich II, Johann Casimir, received Coburg, and the younger, Johann Ernst, received Eisenach. Johann Wilhelm retained only the smaller part of the duchy, the region around Weimar, but he added the districts of Altenburg, Gotha, and Meiningen to his territories. As a result of the Division of Erfurt, all of the territorial possessions of the House of Wettin, no matter which branch ruled the individual components, became contiguous. The house of Saxe-Weimar and the first house of Saxe-Altenburg, which later separated from Saxe-Weimar, both descend from Johann Wilhelm.