Denmark was mostly "liberated" by a surrender of German armed forces in the Netherlands, Northwest Germany, and Denmark to British Field Marshal Bernard Montgomery This took place on May 4, 1945 at Luneberg Heath, Germany.
This surrender was initiated by the Flensburg government in nearby Flensburg, Germany, under Admiral Karl Doenitz, who had been appointed as Hitler's successor in Hitler's last will and testament (the Navy was the one branch of service that had not disappointed Hitler).
The Bornholm Island, well east of the rest of Denmark, was occupied by Soviet troops on May 9, 1945, notwithstanding the earlier surrender of Denmark discussed above.