Spain's state prosecutor has ordered a criminal probe of all 700-plus Catalan mayors who have backed an independence referendum, as Madrid seeks to block the separatist vote it deems illegal.

The country's prosecutor office on Wednesday ordered the 712 mayors, who have agreed to help stage the October 1 vote, to be summoned to court as official suspects and called for their arrest in case of a refusal to appear for questioning.

Catalonia's regional parliament passed a law last week in preparation for the October referendum.

Spain's Constitutional Court suspended the independence vote after Prime Minister Mariano Rajoy challenged it in the courts.

Judges are now considering whether the legislation contravenes Spain's constitution, which states that the country is indivisible.

OPINION: Catalonia's declaration of independence

Spain's state prosecutor had vowed to present criminal charges against members of the Catalan parliament who voted in favour of the region holding a referendum on independence.

So far, 712 of a total 948 municipal leaders have said they would allow public spaces to be used for the referendum, although the mayor of the region's most populous area - the city of Barcelona - has yet to take a definitive position.

Wednesday's ruling increases the pressure on Catalan officials just one day before the pro-separatist camp officially kicks off its referendum campaign in the Mediterranean port of Tarragona.

"They can't arrest us, they're crazy!," David Rovira, the pro-separatist mayor of L'Espluga de Francoli, a town of some 3,800 residents, told AFP news agency, adding that Madrid had "proposed nothing" to appease Catalonia's demands for greater autonomy.

Joan Rabasseda, the separatist mayor of Arenys de Munt which in 2009 became the first town in Catalonia to hold a symbolic independence referendum, told AFP that he was simply "obeying" the law calling the referendum passed by Catalonia's regional parliament.

'Illegal act'

The ruling comes a day after prosecutors ordered police in Catalonia to seize ballot boxes, election flyers and any other item that could be used in the referendum.

Prosecutors have already launched an official complaint against Catalan President Carles Puigdemont and members of his government over their referendum plans, accusing them of civil disobedience, misfeasance and misappropriation of public funds - the latter carrying jail sentences of up to eight years.

In a separate order on Wednesday, the Constitutional Court told regional government officials they had 48 hours to show how they were preventing the vote from going ahead.

Prime Minister Mariano Rajoy's conservative government has vowed to do everything in his power to stop the referendum. It argues Spain's 1978 constitution stipulates that regional governments cannot call an independence referendum.

Rajoy on Wednesday urged Catalans to boycott the referendum.

"If anyone urges you to go to a polling station, don't go because the referendum can't take place, it would be an absolutely illegal act," he said.

Barcelona Mayor Ana Colau, who opposes secession but supports a vote, says she wants to help arrange the referendum but won't do so without assurances that she and her staff would be acting legally.

Spain's King Felipe VI also entered the fray on Wednesday, stepping up the pressure on Catalonia by vowing that the Spanish constitution "will prevail" over any attempt to break the country apart.

In his first comments on the growing political crisis, Felipe VI said the rights of all Spaniards would be upheld against "whoever steps outside constitutional and statutory law."

Hundreds of thousands of people took to the streets of Barcelona this week to show support for independence.

Opinion polls show that Catalans are evenly divided on independence, but over 70 percent want a referendum to take place to settle the matter.