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.

(AP)Thousands cheer and wave esteleda, or Catalonia independence flags, during the ‘Yes’ vote closing campaign in Barcelona (AP)

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.

(AP)With ‘esteladas’, the pro-independence Catalan flag, on their backs, youngsters attend a closing campaign rally for the ‘Yes’ vote (AP)

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”.

(AP)A man steers his ‘yes’ tractor during a protest by farmers in Barcelona (AP)

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.

People walk by leaflets of the People walk by leaflets of the “Yes” vote campaign on the ground in Barcelona (Bob Edme)

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.

Police block the entrance of the city hall as protesters wave Spanish national flags in the central Cibeles square in MadridPolice block the entrance of the city hall as protesters wave Spanish national flags in the central Cibeles square in Madrid (Paul White/AP)

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.