BARCELONA, Spain -- The ballot boxes arrived from France under the cover of night, were stored in homes and improvised hiding places, and then secretly shuttled to polling stations right under the nose of police.
Grassroots activists who staged a disputed referendum of independence in Catalonia described to The Associated Press how they managed to hold the Oct. 1 vote despite a police crackdown that left hundreds injured.
"It was cat and mouse," said one activist who was in charge of organizing the vote in a village of about 2,000 residents south of Barcelona.
"In order to not jeopardize the operation, you were told that on such a day at such an hour a ballot box would arrive, and then a few days later, the ballots. The vans would arrive at night," he said.
Three activists and a source close to the regional Catalan government spoke about the plan on condition of anonymity, fearing prosecution by Spanish authorities, who had declared the vote illegal.
By using code words and clandestine meetings with information strictly limited to a need-to-know basis, hundreds of separatists defied the law - and the odds - by keeping what they claim were 10,000 ballot boxes hidden in tiny stashes around the region and out of the hands of authorities for weeks.
A source close to the regional government who had been briefed about the operation said the ballot boxes, which look like large Tupperware containers with the Catalan government seal, had been ordered online from a Chinese company. They were shipped to a location in southern France.
From there, the ballot boxes were smuggled across the Spanish border in small loads, an activist with knowledge of overall planning said. They were then distributed from one trusted separatist to another, without any single person knowing who else was involved beyond their direct contacts to avoid the police from taking down the operation in one fell swoop.
"Everything was done on a very small scale," said the activist. "You would receive a message from somebody who had to distribute 100 ballot boxes to people you trusted. There was no macro-planning on a general level."
The same activist said that any talk of the operation via mobile phone was done in coded language, such as "tomorrow you will receive 10 cakes for your mother" or "you have to hand out five cakes to your mother and five to your father."
Another activist who hid ballot boxes in his home and organized the vote in a village in the Osona county north of Barcelona said that he used the terms "shoe boxes" or "presents" to stand in for ballot boxes.
Regardless of the intricate plan, the chances of holding the vote looked very slim on the eve of the referendum, even when officials of the Catalan regional government finally unveiled one of the ballot boxes to journalists.
In the previous two weeks, police had confiscated millions of ballots in raids, taken out the computing systems for the vote, and arrested around a dozen Catalan government officials suspected to have been involved in the planning for the referendum. That led Spanish Prime Minister Mariano Rajoy to declare that the infrastructure for the referendum was dismantled. Just to make sure, the Interior Ministry sent thousands of extra police officers to the region.
But Catalonia's leaders urged people to go to the polls on Sunday anyway, assuring would-be voters the ballot boxes would be there.
An AP reporter witnessed the arrival of a ballot box to a polling station early Sunday when rain was drizzling on a crowd outside the Jaume Fuster high school in Barcelona. A small red hatchback pulled up and a man and woman popped the trunk, grabbed a plastic bag with the ballot boxes inside, and hustled them through the hushed crowd and into the school.
A couple of hours later those same ballot boxes would be grabbed by officers of the National Police, after agents in riot gear had shoved through the crowd and shattered the school's front door with a mace.
Once videos of the police raids at that school and several others across the region went viral, organizers started to make backup plans.
"I stationed some girls down the road so they could warn us (if police came) and give us a five-minute head start. We were planning to hide the ballot boxes down by the river," the man who organized the vote in the village south of Barcelona said.
His counterpart in Osona said that he decided to stop voting early just to make sure the police didn't get there in time. They then did the recount in a home in an isolated area.
A call and email to Spain's Interior Ministry asking about the activists' plot were not immediately answered.
Catalan officials said police had closed or raided 400 of the more than 2,000 polling stations before or during the vote. Nonetheless, they said 2.2 million votes were cast, with 90 percent in favor of independence.
The result was not surprising given that many Catalans opposed to independence were not expected to turn out. The last regional election and polls show that the 7.5 million residents of Catalonia are almost evenly divided on the issue.
Many of the people involved in the organization of the vote were activists aligned with the Assemblea Nacional Catalana, the main grassroots secessionist group that counts 40,000 members and another 40,000 sympathizers. Analysts say the ANC has been the driving force behind the independence movement.
ANC president Jordi Sanchez, whose Twitter account boasts a photo of one of the ballot boxes, and the leader of another separatist group Jordi Cuixart, are being investigated for alleged sedition in connection protests ahead of the referendum. Both were released after questioning by a Madrid judge on Monday but are to be questioned again in coming days.
Catalan regional president Carles Puigdemont has vowed to declare independence based on the result. That could happen as early as Monday.
AP writer Aritz Parra contributed to this report.