In May 1944, Iceland held a constitutional referendum to decide whether to dissolve the personal union with Denmark and adopt a republican constitution. The referendum was overwhelmingly approved, with over 98% of voters in favor of both measures. The Act of Union, which had kept Iceland and Denmark connected under the Danish king since 1918, was officially abolished, and Iceland became a republic.
On June 17, 1944, amid World War II and while Denmark was still under Nazi occupation, Iceland declared itself an independent republic in a ceremony at Þingvellir. Although some Danes were offended by the timing, King Christian X of Denmark sent his congratulations. Sveinn Björnsson, who had served as Iceland's regent during the war, was chosen by parliament as Iceland's first president. This marked the final step in Iceland's peaceful journey to full independence.