German unification was agreed by treaty in November 1870 with the accessions of Bavaria and the other southern German states of Baden, Hesse and Württemberg to the Constitution of the German Confederation, which were negotiated at Versailles Palace. The term "German Confederation" was already changed in December to "German Empire" in the constitution, which largely corresponded to that of the North German Confederation founded in 1866. During the Franco-Prussian War, which had already been decided by the end of 1870, a German federal state was created under Prussian leadership. Bavaria, ruled at this time by King Ludwig II (1845-1886), largely lost its position as a sovereign state against the will of the monarch. However, it was granted a whole series of reserve and special rights and therefore occupied a certain special position within the German Reich. For example, the Bavarian army remained independent and Bavaria retained sovereignty over its military in times of peace. Bavaria also retained its own railways, the taxation of beer and brandy, a largely independent postal and telegraph service, and its own laws on homeland, settlement, and marriage. The vice-presidency of the Bundesrat was also awarded to the southern German kingdom. The new constitution finally came into force on 1 January 1871. As early as April 1871 it was replaced by the "Constitution of the German Empire", which was once again slightly modified.