Prince Henrik, the husband of Denmark's Queen Margrethe II, died late Tuesday at age 83 from a lung infection, the palace said in a statement.
Prince Consort Henrik died in his sleep with Margrethe and the couple's two sons at his side, according to the statement.
"The royal family has lost an anchor," Prime Minister Lars Loekke Rasmussen said in a statement.
The palace had warned earlier on Tuesday that Henrik had returned home "to spend his last days."
Henrik, born in France as Henri Marie Jean André de Laborde de Monpezat, married Margrethe, heir to the Danish throne, in 1967. She was crowned queen five years later.
However, for years he publicly chaffed at being denied the title King Consort, which would have placed him in the line of succession. As is traditional in most countries for men married to female monarchs, the title given him was Prince Consort. The couple's eldest son, 49-year-old Crown Prince Frederik, is heir to the throne.
In August, Henrik caused a stir when he said he did not want to be buried next to Margrethe, who already had a specially designed sarcophagus for the couple and the expectation that their remains would be placed in Roskilde Cathedral in eastern Denmark, where Danish royals have been interred for centuries.
"It is no secret that the Prince for many years has been unhappy with his role and the title he has been awarded in the Danish monarchy. This discontent has grown more and more in recent years," the Royal Danish House's director of communications was quoted by Reuters as saying at the time.
"For the Prince, the decision not to be buried beside the Queen is the natural consequence of not having been treated equally to his spouse - by not having the title and role he has desired," the spokesperson told the wire service.
A month later, Henrik was diagnosed with dementia.
Although the monarchy has no real power, the family is beloved by most Danes, many of whom expressed their condolences on the royal Facebook page.
The Associated Press reports:
"Flags were at half-mast on public and private buildings across Copenhagen, including the city's famed downtown amusement park Tivoli. National radio channels changed their morning programs to broadcast more austere music interrupted by anecdotes about Henrik's life.
The royal household on Wednesday announced a month of mourning during which royals will wear dark clothing and not participate in social events. It also said military staff would wear black arm bands."
The palace statement announcing Henrik's death did not say where he would be buried but the BBC reports that, "Following his wish, he will be cremated, with half his ashes spread over Danish seas and the other half buried in the royal private garden at the Fredensborg Castle."