Prince had lamented fact he was not titled as king and said he would refuse to be buried next to his wife in protest

Prince Henrik, the French-born husband of Denmark’s Queen Margrethe, has died aged 83, ending a half-century struggle to win the hearts of Danes that only succeeded in his later years.

The royal family declared a month of mourning and flags were lowered to half-mast nationwide on Wednesday.

Diagnosed with dementia last September and hospitalised in Copenhagen since 28 January for a lung infection, Henrik died on Tuesday.

A private funeral will be held next Tuesday at the Christiansborg Palace chapel in the capital, the palace said.

In line with Henrik’s wishes, he will be cremated. Half of his ashes will be spread in Danish waters and half buried on the grounds of Fredensborg Castle, north of Copenhagen.

Lars Løkke Rasmussen, the Danish prime minister, said the prince had “represented Denmark magnificently. His commitment was infectious, and his insight great.”

The prince was a bon vivant who enjoyed cooking, poetry and wine. But frequent outbursts of anger and a flamboyant style in a country that values humility and discretion irritated some.

He moved to Denmark in 1967 before his June wedding to the then crown princess, but found having to play a supporting role difficult. Disappointed that his royal title was never changed to king when his wife became queen in 1972, Henrik voiced his frustration in the media, which did not endear him to Danes who found him arrogant.

He retired from public service in 2016 and then announced he did not want to be buried next to his wife because he was never made her equal. His decision broke with the tradition of burying royal spouses together in Roskilde Cathedral, west of Copenhagen.

Play Video 0:24 Wedding of Prince Henrik and Queen Margrethe II in 1967 – archive video

Teased for his French accent and unable to understand why protocol required him to remain in his wife’s shadow, Henrik never really found his place in Denmark. “A lot of people think I’m a loser until I prove them wrong,” he once said.

It was not until 1997 that he stood in for his wife at a public engagement for the first time. “People are just used to considering Prince Henrik as … a little dog that follows behind and gets a sugar cube once in a while,” he said.

In 2002 he made headlines when he fled to his chateau in southern France to “reflect on life”, complaining he did not receive enough respect in Denmark after his son, Crown Prince Frederik, was chosen to represent the queen at a New Year ceremony instead of him. He said he felt “pushed aside, degraded and humiliated. My self-respect is destroyed.”

Some politicians said Henrik’s behaviour was “tiresome”, while the media had a field day, one television show conferring on him the title of “Whiner of the Year”. But it also marked a turning point as Danes saw a more vulnerable side of Henrik and slowly started to warm to him. Over time, his contrarian streak and flamboyance helped earn him cult status among young people.

In 2013 he collaborated with the Danish pop group Michael Learns To Rock, playing the piano on a track recorded for the king of Thailand. Months later he was photographed strolling with friends in the self-governed Copenhagen hippie community of Christiania, known for its cannabis trade, and in June 2014 he dressed up in a panda costume at a charity event.