The Danish royal family released a statement on Tuesday in Danish which translated as "His Royal Highness Prince Henrik has today been transferred from Rigshospitalet to Fredensborg Castle, where the Prince wishes to stay in his last time".
In January, Prince Henrik was flown back to Denmark from a trip in Egypt after falling ill - after doctors found a benign tumour in his lung.
His flamboyant style was both loved and criticised by Danes.
In a tradition similar to that of the British royal family, the husbands of Danish queens are given the title of prince consort rather than king, as awarding them the higher role would elevate them above their wives in the traditional royal hierarchy. The queen said she would not change her funeral plans.
The statement added the Queen and their two sons were at his side when he died at about 11.18pm, on Tuesday. His eldest son, Crown Prince Frederik, left the Winter Olympics and returned to Denmark to be by his father's side on February 9.
As in most monarchies, a Danish princess becomes queen when her husband takes the throne, but a man does not become king through being married to a queen.
He had often spoken of his frustration at being denied the title of king.More news: Metro, Dead Island, Saints Row Publisher Koch Media Acquired By THQ Nordic
More news: Trump's lawyer admits paying $130K to Stormy Daniels
More news: Twenty-First Century Fox Inc (FOX) Stake Lowered by Lee Danner & Bass Inc
In 2017, Henrik was admitted to the hospital several times before being diagnosed with dementia in September.
It is traditional for male members of the royal family who marry female monarchs to be titled as a prince consort, just as Prince Philip is titled owing to his longtime marriage to Queen Elizabeth II. He had felt "pushed aside, degraded and humiliated", and his self-respect was being destroyed. This discontent has grown more and more in recent years.
While the episode became a source of joke for many, it was a turning point for others, especially many young Danes, who thought his manner represented a break from the norms of cultural uniformity in Danish society.
Known for his love of wine and food, the prince also wrote poetry, made sculptures and published cookery books.
He formerly held the title of Prince Consort but renounced that title when he retired from his official duties in 2016.
The royal couple set up home in Denmark, where "Henri" became Henrik. Crown Prince Frederik cut short his visit to the Winter Olympics in South Korea to be with his father at Fredensborg Palace, where he spent his final days.