COPENHAGEN — Denmark’s Crown Prince Frederik was formally proclaimed king by the country’s prime minister on Sunday.

Earlier in the day, Danish Queen Margrethe signed a declaration of abdication and handed the throne to her son, then crown prince Frederik. Thousands of people gathered outside the palace where the royal succession occurred on Sunday, celebrating the event.

In her address delivered on New Year’s Eve, Queen Margrethe announced that she would be abdicating on January 14 and that she would hand over the throne to her eldest son. She justified it with a back operation that she had in February.