The immigrants claim that they fled the Gdeim Izik refugee camp in the territory of Western Sahara, a former Spanish colony annexed by Morocco in 1975, after it was forcibly dismantled by the Moroccan police, according to a Council of Europe press release.
They arrived on makeshift boats on the coast of Spain's Canary Islands in 2011 and lodged applications for international protection.
These were rejected after being considered twice by the Spanish Minister of the Interior who ordered their deportation.
Seeking a stay of execution for their deportation orders, they applied in January 2011 for a judicial review and Spain's National Court ordered a provisional suspension of the procedure for their removal.
This would allow the court to thoroughly examine their allegations about the risks they would face if they were returned to Morocco.
But the following day, the court rejected the asylum seekers' application for a stay of execution.
The asylum seekers then turned to the European Court of Human Rights (EHCR).
They claimed that they had been subjected to ill-treatment by the Moroccan authorities because of their Sahrawi origin and that they would feel threatened in the event of their return.
The immigrants alleged they had been physically assaulted and that some of their family members had been sexually assaulted or tortured by police officers.
In the findings of the hearing, the court noted that the asylum-seekers' fears "did not seem irrational" and noted that "because of the expedited nature of the proceedings, the applicants had not had the opportunity to provide any further explanations on these points".
The EHCR found unanimously that there had been a violation of Article 13 (right to an effective remedy) and Articles 2 (right to life) and 3 (prohibition of inhuman or degrading treatment).
The court held that Spain "was to ensure that the applicants remained within its territory while their cases were being examined, pending a final decision by the domestic authorities on their applications for international protection".