schleswig was a duchy created by the king of denmark, and eventually the title reverted to the danish crown. holstein was a fief of the holy roman empire that also was inherited by the king of denmark. after napoleon's defeat holstein joined the german confederation. german nationalist movements within the duchies and a succession dispute to the duchies led to the second schleswig war in which the german confederation led by austria and prussia defeated denmark, forcing its king to renounce the duchies. a disagreement in how to administer them led to the austro-prussian war in which prussia was victorious and annexed both duchies, allowing king william i to add their titles to his grand title.