Margrethe, 83, stunned the nation on New Year’s Eve when she announced she planned to become the first Danish monarch in nearly 900 years to voluntarily relinquish the throne.
The succession was formalised the moment she signed the declaration of her abdication during a meeting of the Council of State at Parliament on Sunday, the royal palace said.
Denmark, one of the oldest monarchies in the world, does not have a coronation.
The meeting was attended by government representatives, Margrethe, Frederik, 55, his Australian-born wife Mary, 51, who is now queen, and their oldest son Christian, 18, who is the new heir to the throne.
After the signing, Denmark’s Prime Minister Mette Frederiksen proclaimed Frederik king on the balcony of Christiansborg Palace in Copenhagen.
“My hope is to become a unifying king of tomorrow,” Frederik said in his first speech as king.
“It is a task I have approached all my life. It is a task I take on with pride, respect and joy,” he spoke overlooking large crowds of cheerful people.
Moments later, he was joined on the balcony by his wife and children, including Princess Isabelle, 16, and twins Princess Josephine and Prince Vincent, both 13.
Huge public support
In close to freezing temperatures, tens of thousands of people from across Denmark converged on the capital to witness the events, in a sign of the huge popularity the monarchy is enjoying in the nation of nearly six million.
“We have come here today because this is history being made in front of our eyes. We just had to be here,” Soren Kristian Bisgaard, 30, a pilot, told Reuters news agency.
“I’m very fond of the royal family. I have been in the Royal Life Guards myself, standing guard at the royal palace.
“I’m very proud to have done that and also to be here today,” he added.
King Frederik and his wife take the throne at a time of huge public support and enthusiasm for the monarchy.
The most recent survey done after Margrethe announced she would abdicate indicated that 82 percent of Danes expect Frederik to do well or very well in his new role, while 86 percent said the same about Mary.
Queen Margrethe
Born in 1940, Margrethe has been one of the most popular public figures in Denmark.
The 1.82-metre (6-foot) tall, chain-smoking monarch often walked the streets of Copenhagen virtually unescorted and won the admiration of Danes for her warm manners and her talents as a linguist and designer.
A keen skier, she was a member of a Danish women’s air force unit as a princess, taking part in judo courses and endurance tests in the snow. Margrethe remained tough even as she grew older.
In 2011, at age 70, she visited Danish troops in southern Afghanistan wearing a military jumpsuit.
As monarch, she crisscrossed the country and regularly visited Greenland and the Faeroe Islands, the two semi-independent territories that are part of the Danish Realm.
Frederik was born to Queen Margrethe and Prince Henrik in Copenhagen, Denmark. He has one sibling – younger brother Prince Joachim.
Frederik is also part of the Evangelical Lutheran Church of Denmark (also known as the Danish National Church), a requirement for the Danish royal family, particularly for reigning monarchs.
He will reign as king over Denmark, Greenland and the Faroe Islands. However, the formal power will remain with the elected parliament and Denmark’s government.