On hearing news of the treaty, Prince Christian Frederick of Denmark and Norway, the resident viceroy in Norway, participated in founding a Norwegian independence movement. The independence movement was successful, partly due to clandestine support from the Danish Crown, but also because of the strong desire for independence in Norway. On 10 April, a national assembly met at Eidsvoll to decide on a constitution. Norway eventually declared independence on 17 May 1814, electing Christian Frederik as King. A short war with Sweden later that year ended with the Convention of Moss. This led to the ousting of Christian Frederick, and the Norwegian Storting electing Charles XIII of Sweden as King of Norway, creating the union between Sweden and Norway. In turn the king recognised the Norwegian constitution which was only changed to facilitate the union.