Catalonian separatists have vowed to ignore a police ultimatum to leave the school polling stations they are occupying ahead of a disputed referendum on the region's independence from Spain.

The police deadline of 6am on Sunday for the activists, parents and children in the Catalan schools is designed to prevent the vote from taking place, since the polls are supposed to open three hours later.

As officers sealed off hundreds of schools, some parents decided to send their children home and prepared for pre-dawn confrontations.

Tensions rose across the country over the planned vote, with thousands marching in Madrid to protest against the separatists' attempt to break up their nation, demanding that Catalan leaders be sent to jail.

In Barcelona, the capital of Catalonia, thousands more took to the streets to urge their prosperous region to stay inside Spain.

Spain's Constitutional Court suspended the independence vote more than three weeks ago and the national government calls it illegal.

Police have been ordered to stop ballots from being cast and have been cracking down for days, confiscating millions of ballots and posters.

Catalonia's defiant regional government is pressing ahead despite the ban and the police crackdown, urging the region's 5.3 million registered voters to make their voices heard.

Spain's foreign minister said on Saturday the Catalan government's plan is anti-democratic and runs "counter to the goals and ideals" of the European Union

"What they are pushing is not democracy. It is a mockery of democracy, a travesty of democracy," Alfonso Dastis said.

He said some pro-independence groups are "adopting Nazi-like attitudes by pointing at people that are against that referendum and encouraging others to harass them".

A top Spanish security official in Catalonia says police have already sealed off more than half of the 2,315 polling stations and disabled software that was to have been used in the referendum.

Enric Millo, the highest-ranking official in the north-eastern region, said parents and students were found to be occupying at least 163 schools but about 1,000 more still need to be checked.

The regional police force has been ordered not to use force in vacating the schools. Mr Millo said anyone remaining in schools after 6am will need to be removed in line with a judge's order.

"I trust in the common sense of Catalans and that people will operate with prudence," he said.

Authorities have already confiscated 10 million paper ballots in the last few days, making it much more difficult for Catalonian officials to carry out an effective vote.

At the Congres-Indians school in Barcelona, designated as a polling place, activist Quim Roy said he would be sending his two daughters home before the deadline out of concern for possible violence. He said other parents planned to do the same.

"Who knows what will happen if the Guardia Civil comes?" Mr Roy said, referring to the Spanish national guard.

He said he would not resort to violence but will not leave the building voluntarily.

"If they tell me I can't be in a public school to exercise my democratic rights, they will have to take me out of here. I won't resist, but they will have to carry me out," he said.

Organisers have set up a range of activities in the schools - including yoga sessions, games, film screenings and picnics - to keep spirits high as the historic confrontation with Spain's central government unfolds.

A pro-independence grassroots group admitted that Sunday's vote could be in jeopardy unless more schools were kept open for it.

Open Schools spokesman Ramon Font told the AP he did not have an exact number on how many schools were being occupied by activists but felt it was more than the number stated by police.

"If the number of schools kept open does not rise, then the ability to exercise our right to self-determination will be in serious jeopardy. It will be very difficult to vote," Mr Font said.

Catalan authorities had hoped previously for a larger turnout than the 2.3 million people who voted in a mock referendum in 2014 in which 80% favoured independence.

The Catalan government has pledged to declare independence from Spain within 48 hours of Sunday if the 'yes' vote wins, no matter what the turnout is.

Sign up to our free newsletters

Get the best updates straight to your inbox:
Please select at least one mailing list.

You can unsubscribe at any time by clicking the link in the footer of our emails. We use Mailchimp as our marketing platform. By subscribing, you acknowledge that your information will be transferred to Mailchimp for processing.