Spain will have to pay compensation to two terrorists belonging to the Basque separatist groups Eta and Segi as a result of the court's ruling.
Beatriz Etxebarria Caballero will receive €24,000 ($30,500) and Oihan Unai Ataun Rojo ($29,000) after Spain failed to investigated claims they were mistreated and tortured while being held 'incommunicado', or without full rights.
Authorities did not carry out proper medical investigations to find out if torture or mistreatment had taken place while the prisoners were being held, the EHCR said in its ruling.
The court's decision was further evidence human rights could not be skirted in terror cases, the Open Society's Justice Initiative said.
It also highlighted the critical obligations countries have to protect their suspects in police stations, the group added.
Marion Isobel, a legal officer at the Justice Initiative, said, "The court has long acknowledged that people in the custody of the police are particularly vulnerable and indeed, most acts of torture occur in the first hours or days of police detention. So this is not only a victory for human rights in Spain. The ruling is applicable to all states in Europe, many of whom still deny crucial safeguards to people in police custody."
In Spain, detainees can be held up to 13 days without contact with their families, and without access to their own lawyer, or an independent doctors.
The EHCR has now called on Spain to ensure greater protection for detainees including the right to contact one individual and inform them of there situation, confidential legal advice and competent medical assistance.
Under EU law, countries have until November 2016 to make sure these conditions are in place.
Caballero was in 2011 sentenced to 40 years in prison for her part in Eta's bombing of a military barracks in Burgos, which saw 66 people injured.
Ataun Rojo was arrested in November 2008 as part of investigations into the Basque separatist group Segi.