The fledgeling Norwegian state was unable to gain support or recognition from any foreign powers, and was defeated in a two-week war with Sweden in the summer of 1814. However, the Convention of Moss, signed at the end of the war in August, preserved many of the independence movement's achievements: Norway remained mostly autonomous in a personal union with Sweden, and was permitted to retain its new constitution with only slight modifications. Christian Frederick, forced to abdicate as King of Norway, would become King of Denmark as Christian VIII in 1839. Norway would eventually fully break away from Sweden in 1905.