A court in north-western Spain has declared that a summer palace used by late Spanish dictator Francisco Franco belongs to the state and his family should hand it over.
The judge ruled that the Pazo de Meirás was given to Franco in 1938 in his role as head of state and not in a personal capacity.
Gen Franco ruled Spain from 1939 until his death in 1975.
His descendants have repeatedly sought to defend his legacy in the courts.
Last year, they lost a legal battle with Spain's Socialist-led government for the right to keep his remains in a mausoleum at a national monument near Madrid called the Valley of Fallen.
What's the background to this case?
In 2018, news that the late dictator's grandchildren had put the palace up for sale for a reported price of €8m (£7m; $9.5m) caused an outcry. Authorities in A Coruña, the Galician province where the property is located, launched a legal challenge.
Built between 1893 and 1907 it was originally owned by the family of Spanish writer Emilia Pardo Bazán.
Things intensified in 2019, when the Spanish government filed a legal claim to ownership of the palace, arguing that an official sale formally transferring the property into Gen Franco and his wife's names in 1941 had been fraudulent.
Although the government was backed by local and regional authorities, Franco's six grandchildren argued that the 1941 sale was valid.
His grandson Francis Franco accused the government of trying to "retaliate" against the Franco family for not backing down over the dispute over the late dictator's remains. The family produced documents to prove they had paid for renovating the property.
What did the court decide?
Judge Marta Canales agreed with a report drawn up in 2018 by historical and legal experts and commissioned by the local authority that said the 1941 sale of the palace to Franco was not a genuine contract, and therefore fraudulent.
She ruled that the original gift of the mansion in 1938 had been handed to the "Generalissimo of the armies and head of state" but not in name to Francisco Franco Bahamonde, as he was known.
What the ruling means
By James Badcock, Madrid
"Franco bought nothing" is the simple key to the judge's ruling, undoing what the dictator's family claimed was an eight-decade story of private property ownership.
Franco was donated the palace in 1938 by community leaders, some of whom coerced underlings into chipping into the fund, in his capacity as leader of Nationalist Spain - and soon to become the nation's undisputed ruler.
But the contract under which the residence was inscribed in the property register as his personal possession in 1941 was "a fiction", making all legal consequences since, including his grandchildren's inheritance of the mansion, null and void.
As well as a matter of legal niceties, the ruling holds significance in rolling back another element from Spain's curious transition to democracy after Franco's 1975 death, during which many elements of the dictatorship were left untouched.
Less than a year after Franco's remains were removed from his grandiose tomb, the fact that the Spanish state finally fought for the Pazo de Meirás demonstrates a shift.
Franco's descendants can still appeal against the ruling, part of their democratic right to impartial justice.
Franco was born in Galicia and, even 45 years after his death, his influence is still felt in Spain.
Juan Carlos, the Spanish king who helped guide Spain to democracy in 1975 abdicated in 2014 amid a corruption scandal.
Last month he announced he was leaving the country as his finances came under close scrutiny.