After their release the following May they testified that they had been tortured and their charges were backed up by a doctor who examined them, the court said in its judgement.
A year later, three police officers were tried and acquitted on charges of mistreating the detainees.
"A State is responsible for everyone in detention, because these people, in the hands of police functionaries, are in a vulnerable position and the authorities have the duty to protect them," the court said, adding that Turkey carried the "responsibility for the injuries inflicted on the applicants".
The court concluded that Ankara had violated article three of the European human rights convention which bans torture and inhuman and degrading treatment.
It fined Turkey a total of 50,000 euros (61,000 dollars) damages to the four complainants, three of whom remain in jail for "membership of an illegal organisation and threatening the constitutional regime".
A week earlier, the court ruled that Turkey, which hopes to eventually join the European Union, had at least badly treated a trade union leader last seen alive while in custody before being found dead in a ditch in 1994.