The UN Committee on Economic, Social and Cultural Rights said on Wednesday that Madrid had violated the family's right to housing by failing to consider their vulnerability and should prevent similar cases from happening.
The mother, Maribel Viviana Lopez Alban, filed a complaint with the committee in June 2018 after attempting for several years to go through the Spanish courts to block her family's eviction.
She maintained that she had been renting an apartment in Madrid for a year when she discovered that the person she had been paying rent to was not the property's legal owner, committee documents showed.
In December 2014, the financial institution that really owned the property initiated eviction proceedings.
The family then applied for social housing, but their request was denied on grounds that people illegally occupying property were barred from the regional social housing programme.
- Meet Madrid's anti-eviction warriors
- Spanish pensioner kills herself over eviction
- Postcards reveal bitter truth of the 'Real Spain'
Children suffered panic attacks
The UN committee, which has no enforcement powers, is made up of 18 independent experts tasked with monitoring whether countries adhere to their commitments under the International Covenant on Economic, Social and Cultural Rights.
It had requested that Spain not evict the family while they were examining the case but the family was forcibly removed from their home by police in anti-riot gear shortly afterwards.
They bounced between temporary shelters and Lopez Alban told the committee her children had suffered panic attacks and learning difficulties.
They were among tens of thousands of people who have been evicted from their homes in Spain since the housing bubble burst and the global financial crisis began in 2007.
The country's national statistics institute NIE tallied that there were 34,680 evictions in 2014 alone at the height of the crisis.
Last year, some 6,500 people were evicted from their homes, according to the latest available statistics.
In its ruling, the UN committee found that the Spanish courts failed to weigh the rights of the property owner against the consequences of an eviction on the family.
It also found that the rejection of the family's request for social housing violated the Covenant.
The UN experts called on Spain to “compensate the victims and to create a legal framework to prevent similar violations in the future.”
They gave Madrid six months to provide an update on its implementation of the ruling.