Regional leaders in Catalonia have moved to defy the central government in Madrid and go ahead with a ballot on independence even though Spain's constitutional court has ordered the vote suspended.
While the pro-independence Catalan government tried to flex its muscles, most of the opposition to the vote - both regional and national - rallied around conservative prime minister Mariano Rajoy and his efforts to crush the planned October 1 ballot.
On Friday, the state prosecutor targeted members of the Catalan parliament and the Barcelona-based regional government in separate lawsuits.
The prosecutor's document asked judges to look into possible disobedience, abuse of power and embezzlement charges against the officials.
Despite the court's suspension of the vote and the legal threats, regional president Carles Puigdemont has pushed ahead with preparations for the ballot.
An official website offers volunteers the chance to register and help with the vote. A promotional video published in official media asks: "You were born with the ability to choose. Are you going to give it up?"
Officials in the north-eastern region claim they have enlisted 560 Catalan town halls to open facilities for the ballot, despite letters sent by Spain's central authorities to the region's 947 mayors warning them that their legal duty is to impede the vote.
Authorities said similar letters were being sent to public Catalan media organisations and the regional police force.
It was not clear what position officials would take in Barcelona, the main city in Catalonia.
Barcelona mayor Ada Colau, an activist against evictions who has become a rising political star, said people should be able to vote as long as there are no liabilities for them or for public servants.
On Friday, central government spokesman Inigo Mendez de Vigo clarified that legal actions are targeting "those who organise the vote" and not voters themselves.
The pro-independence coalition ruling Catalonia says the vote will be binding and that if the "yes" side wins it will lead to independence from Spain by October 3 no matter what the turnout.
Spain's constitutional court has previously ruled that only the national government is allowed to call a referendum on secession and that all Spaniards must have a vote when it comes to sovereignty.
On Friday, Mr Rajoy's cabinet began procedures to strike down a new bill approved overnight by Catalan pro-independence legislators. The new law was meant to become Catalonia's legal framework, or mini-constitution, as it moves from a Spanish autonomous region to an independent republic.