The victims, all poor, were approached "very young" with promises of a good job in Europe.
Authorities detained nine members of a trafficking group that used illegal migration routes to bring them from their home country to Spain. It was headed by three women of Nigerian origin, police said in a statement.
The victims, all poor, were approached "very young" with promises of a good job in Europe, although police did not specify their ages.
They were then submitted to voodoo rituals threatening terrible consequences to them and their families if they disobeyed the organisation, police said, before undertaking a gruelling trip to Europe via Niger and Libya.
Smugglers paid by the group then took them across the Mediterranean to Italy in rickety boats along with scores of other migrants.
"Two of the victims of this organisation had to be rescued by a rescue boat after the boat in which they were travelling sank in the Mediterranean, with various (other) immigrants drowning," police said.
Once in Italy, members of the organisation took them out of migrant detention centres where they had been housed and they travelled to Spain by plane, using ID belonging to other women of Nigerian origin living legally in the country.
Once in Spain, they were instructed to ask for asylum so as to avoid potential deportation.
They were told they owed the organisation between 40,000 and 45,000 euros ($42,000 and $47,000), police said, and forced into prostitution in the northern town of Bilbao and the holiday resort of Benidorm in the east.
"They had to go and prostitute themselves every day and couldn't come back until the early hours of the morning, after more than 14 hours... regardless of the inclement weather or their own health," they added.
Such was the fear of their bosses that one of the victims who fell pregnant aborted straight away and continued to prostitute herself so that they would never know.
Police said the organisation had now been dismantled, and seven victims were rescued.
It was unclear whether there were other girls involved with the organisation.
The rescued girls are not alone, with the International Organization for Migration (IOM) estimating that of the thousands of Nigerian women arriving on Italian coasts, 80 percent are victims of trafficking.