Catalan authorities are racing to stage an independence referendum slated for October 1 which Spain's central government has vowed to stop.
The following are the key pitfalls of the planned plebiscite:
According to the Venice Commission -- a panel of experts who advise the Council of Europe on constitutional law -- a referendum must be organised by an "impartial body".
While Catalonia's referendum law created an electoral commission composed of five members, they all have links with the separatists.
The Catalan government wants the referendum to be similar to a regional election. During the last regional election in September 2015 a total of 8,177 polling stations were set up across the region.
Of Catalonia's 948 municipalities, over 700 mainly smaller ones have pledged to provide locations for polling stations. Several large cities have refused.
Spain's central government has warned Catalan mayors that it is their duty to "prevent or block any initiative related to the organisation of the referendum".
The production of ballots for the referendum has been a headache for Catalan officials, who complain police have searched companies suspected of producing them.
Despite the difficulties, Catalan President Carles Puigdemont announced at the end of August that his government had over 6,000 boxes ready for the referendum but would not say where they were being kept, fearing Spanish authorities would seize them.
Catalonia's recently approved electoral law specifies that the census of people who are entitled to take part in the poll include "voters resident in Catalonia and outside residents".
It closed its voter registration on March 30 but has not revealed how it obtained its list of eligible voters.
Spain's central government argues it has the exclusive authority to carry out an electoral census, which means the Catalan government may have violated Spain's data protection laws.
Electoral lists must be transparent and public.
Some 5.5 million Catalans were eligible to vote in Catalonia’s last regional election in 2015, including 200,000 who lived abroad.
Each polling station must have a president and two assistants who are chosen in a draw from the list of names on the electoral census. This means at least 24,000 people will be needed to carry out the referendum.
The regional government is also seeking thousands of volunteers to help it stage the vote.
Spain's central government has warned that Catalan officials and civil servants could face sanctions, and even criminal charges, if they help organise the vote in any way but it has remained unclear about if volunteers could face trouble as well.
The Catalan government is counting on its regional police force, the Mossos d'Esquadra, to provide security on the referendum day. But Spain's Constitutional Court has asked police forces not to participate in the organisation of the vote.
The referendum law stipulates the official campaign will be held September 15-29.
All political parties with representation in the regional assembly are allowed free airtime on television and radio to make their case to voters.
But there are doubts that parties that oppose Catalan independence, and are calling for voters to abstain from taking part in the referendum, will use their airtime, giving the vote less legitimacy.
The Catalan referendum law calls for the participation of international observers. So far only one name has been unveiled, that of Daan Everts, a Dutch expert on Kosovo.
He is expected to lead an observation mission made up of people from the United States, France, Britain and Poland. Their identity has not yet been disclosed.
The election commission must guarantee that the referendum respects voting rules, deal with appeals and announce the result. But since its members are all from the separatist camp, its decisions will undoubtebly be contested.