By James Rodgers
BBC News, St Petersburg
It was the dying wish of an empress. For decades after her death, though, it seemed it would never be fulfilled.
Royalty from across Europe attended the ceremony
Maria Fyodorovna died in exile. The communist regime which had driven her from Russia would never have considered allowing her to be buried here.
Now, her wish was granted.
With the Soviet authorities long gone, the empress's remains returned. They were re-buried next to her husband, Tsar Alexander III, and her son, Nicholas II, Russia's last emperor, in the Peter and Paul Fortress in St Petersburg.
Guardsmen from the Kremlin and the Danish Royal Court carried the coffin. The head of the Russian Orthodox Church, Patriarch Alexy II, conducted the service.
Royalty from across Europe had come for the ceremony which began across town with a service in St Isaac's Cathedral.
Its golden dome is a landmark that the Empress would instantly have recognised from the skyline of the city she came to love.
"The return of the dead empress is a symbol of the continuity of Russian history," Patriarch Alexy II told the congregation.
"Today's event proves that the memory and traditions of pre-Revolutionary Russia are coming back."
Maria Fyodorovna herself never accepted that the dynasty she had married into had been swept away.
Right up until her death in 1928, she continued to insist that her son, his wife, and five children were in hiding for their own safety.
In reality, they had been shot by Revolutionaries.
The Soviet regime reviled them as bloody tyrants. Post-communist Russia has taken a different view. The tsar and his family were re-buried in 1998.
For St Petersburg historian Sergei Podbolotov, the re-burial of Maria Fyodorovna represents Russia's continuing quest to define its modern self.
Princess Dagmar married Tsar Alexander III in 1866
"Russia now is in a crossroads in choosing her identity. The imperial symbols very often go hand in hand with, for example the body of Lenin, which is still on Red Square," he told me, referring to the mausoleum which houses Russia's revolutionary leader.
"So, Maria Fyodorovna is a strong call for the leaders of the country to finally choose its identity."
Across the square from St Isaac's cathedral, there is an exhibition of photographs.
For most of the last century, it would have been unthinkable to put them on public show. This exhibition has attracted thousands of visitors.
It tells the extraordinary story of the teenage Princess Dagmar, who came from Denmark to marry the heir to the Russian throne. She took a Russian name, Maria Fyodorovna. She became empress, and mother of the last emperor.
She made her first journey here in 1866. Her remains were returned on the 140th anniversary of the day she first set foot on Russian soil.
She loved her second homeland, living in Russia for 63 years before she was forced to flee. She died in Denmark.
Her sister, Alexandra, married Edward VII. Prince Michael of Kent is Queen Alexandra's great grandson. He attended the ceremony as the representative of the Queen Elizabeth II.
"In those terrible days of the revolution, she shone as an example not only to her own family, but to all those around her, of stalwart resistance to the horrors that went on around her," he told me.
"So I think that as a beacon of somebody to look up to as an example, she was remarkable."
Modern Russia cannot quite decide whether she was a near-saint or part of a tyrannical dynasty. They have, though, accepted her back as one of their own.