The casket was carried to the royal mausoleum in the crypt at Akershus Castle

Oslo (AFP) - Norway bid farewell Wednesday to King Harald V in a funeral reflecting his open and unifying nature, and attended by dignitaries including Ukraine President Volodymyr Zelensky and Britain’s Prince William.

After a procession through the streets of Oslo packed with crowds and a funeral service at Oslo’s Lutheran cathedral, the king’s casket was transported to the Akershus Castle church where it was to be placed in the royal crypt.

Until his death on August 28 at age 89, Harald was the oldest reigning monarch in Europe and hugely popular among Norwegians, despite the scandals that dogged his family toward the end of his reign.

Some 48,000 people lined the streets for the procession, police said.

“He was our rock,” Inger Elise Kolsto, a 63-year-old accountant, told AFP.

Britain's future king, Prince William, and his aunt, Princess Anne, were among the guests

Carried on an artillery carriage, the king’s casket, draped in the red royal banner, was transported along the city’s main avenue, followed on foot by his son and heir King Haakon VIII, members of his family, and dozens of other dignitaries.

Only Harald’s widow, 89-year-old Queen Sonja, and the new Queen Mette-Marit, who underwent a lung transplant in June, followed the procession in a car.

Among other guests were Scandinavia’s royal families, royal couples from Spain, Belgium and the Netherlands, the crown prince of Japan, the presidents of Finland and Germany, and the French and Thai prime ministers.

- Sarcophagus -

The church service began at 1:00 pm with a nationwide minute of silence.

“He struck a balance between being stately and being down-to-earth,” Norwegian Prime Minister Jonas Gahr Store said in his eulogy.

“He made Norway greater. He spoke of a ‘we’ in Norway where everyone is there for each other.”

Queen Mette-Marit's son Marius Borg Hoiby was allowed to attend despite a conviction

Marius Borg Hoiby, Mette-Marit’s son from a previous relationship who is under house arrest pending the appeal of a rape and assault conviction, had been granted permission to attend the funeral.

At the end of the service, four F-35 fighter jets flew over the cathedral in formation, as the casket made its way to the Akershus Castle.

There, after a private ceremony with the family, the casket was to be lowered into the crypt of the royal mausoleum, next to Harald’s parents and grandparents.

He was to be laid to rest in a $2 million sarcophagus whose design remains secret.

On the throne since 1991, Harald had always ruled out abdicating, despite mounting health woes toward the end of his life.

Norway's new king, Haakon VIII, and the kings of Sweden and Denmark saluted the coffin

Seen as embodying an open and tolerant Norway, Harald made a deep impression by celebrating diversity in a 2016 speech.

“Norwegians are girls who love girls, boys who love boys, and girls and boys who love each other,” he said, adding: “Norwegians believe in God, Allah, the Universe and nothing.”

In that vein, several religions were represented at Wednesday’s funeral service. A representative of Norway’s indigenous Sami community also held a eulogy to the king in the Sami language.

Once the funeral was over, flags across the country, which were lowered to half-mast after Harald’s death, were once again raised and church bells rang for an hour.

From the balcony of the palace in central Oslo, the royal family then waved at the cheering crowd that had gathered.

The funeral took place under high security, with almost 3,000 police deployed.

- Reinvigorated monarchy -

The square in front of the palace has been covered with flowers, drawings and candles for days as Norwegians honoured the man they dubbed “the grandfather of the nation”.

Ukraine's President Volodymyr Zelensky and First Lady Olena Zelenska walked behind the coffin

“He was like the beloved grandfather of a family, who embraced all his children and grandchildren, regardless of their appearance or beliefs,” student Arthur Fosheim told AFP.

“He truly embodied that spirit of inclusion and a multicultural Norway,” he added.

Almost three out of four Norwegians, 72 percent, said they support the monarchy, up by eight percentage points from a previous survey in May, in an opinion poll conducted after the king’s death and published last week.

Support had dropped to its lowest level in February, to 60 percent, when the royal family was embroiled in a series of scandals.

Mette-Marit in particular was under heavy criticism for her past ties to the late convicted American sex offender Jeffrey Epstein, and her son’s legal troubles.

While Haakon VIII, 53, is very popular, opinions on the new queen, also 53, remain deeply divided.