Spanish police have sealed off most public buildings earmarked as polling stations for a banned referendum on Catalonia's breakaway from Spain, according to officials.

Separatists in the northeastern region on Friday evening and Saturday morning started occupying voting stations in a bid to ensure Sunday's poll, which has been declared illegal by Spanish authorities, goes ahead.

READ MORE: Catalonia independence referendum - All you need to know

The Spanish interior ministry said in a statement on Saturday that the "majority" of public buildings that had been identified as referendum sites had "stayed shut" and "only a few" are occupied by people "with the only aim" of obstructing police work.

The central government in Madrid had previously said that 1,300 of 2,315 designated voting stations have been sealed off by police, who have been mobilised in the thousands in the region.

Also earlier on Saturday, Enric Millo, the highest-ranking Spanish official in Catalonia, had said that parents and students were found to be occupying 163 schools and holding activities when police were sealing off facilities.

'Key battlegrounds'

Catalonia is a wealthy region within Spain that accounts for about 20 percent of the country's economy. It has its own language, which is taught in schools and universally spoken.

Tens of thousands of Catalans are expected to attempt to vote in a ballot that will have no legal status as it has been blocked by Spain's Constitutional Court and Madrid for being at odds with the 1978 constitution.

Al Jazeera's Karl Penhaul, reporting from Catalonia's capital, Barcelona, said that poll supporters spent the night in schools with their children.

"Citizens and families here have been getting together and organising defence committees. They know that those schools have become key battlegrounds in Catalonia's political struggle," he said.

OPINION: The case against Catalan secession

Speaking from a central Barcelona school, where adults and children slept in sleeping bags on gym mats, a separatist supporter who identified herself only as Giselle said: "We slept and waited for them (police) so that they would not try to evict us or tell us what they wanted.

"They came once and they were very polite. We told them we were inside and in peace," she told Reuters news agency.

Police have been ordered not to use force, but to vacate the schools by 6am (04:00 GMT) on Sunday, in advance of the scheduled opening of polls at 9am (07:00 GMT).

Millo said anyone remaining in schools after 6am will need to be removed in line with a judge's orders, but predicts there won't be significant problems.

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

OPINION: Why Catalonia should be given a say on its future

The Catalan regional government said police had also occupied its communications hub and would remain there for two days after Catalonia's High Court ordered police to prevent electronic voting and instructed Google to delete an application it said was being used to spread information on the vote.

But despite the efforts to prevent the referendum, Catalan leaders remained defiant, with the region's foreign affairs chief telling Al Jazeera on Friday that the vote "is impossible to stop".

Raul Romeva also called on the Spanish government to allow Catalan voters to "solve the situation by democracy" and reassured that "there is not a single reason to believe that there is a risk of violence" on Sunday.

On Friday evening, about 10,000 supporters of the referendum gathered off Barcelona's Placa d'Espanya, or Spain Square.

Catalan leader Carles Puigdemont said regardless of how many people actually cast the ballots, if a majority say "Yes", he will declare independence on Tuesday.

"In these hugely intense and hugely emotional moments, we sense that what we once thought was only a dream is within reach," Puigdemont told a cheering crowd.

"On Sunday, we have a date with the future."

READ MORE: Catalan leader accuses Spain of 'totalitarian' actions

The mood, however, was markedly different in Spain's capital, Madrid, where thousands of people rallied on Saturday in favour of Spanish unity on Saturday

Waving red and yellow Spanish flags, the demonstrators gathered in the central Plaza de Cibeles, in front of the capital's town hall, chanting "Catalonia is part of Spain!" and "I am Spanish, Spanish, Spanish!" - a cry usually heard during national team football matches.

"There was a depth of feeling here that we haven't seen in the rest of Spain in the last few weeks. People have been rather mute in their response to this referendum crisis but today they voiced their opinions," Al Jazeera's Tony Birtley, reporting from Madrid, said.

"Everyone we spoke to was unanimously in favour of Catalonia staying in Spain and some of them were calling for the jailing of the Catalan leadership, so feelings are running high."

Opinion polls show Catalonia's roughly 7.5 million residents are divided on independence.

A survey commissioned by the regional government in July showed 49.4 percent of Catalans were against independence while 41.1 percent were in favour.

More than 70 percent of Catalans want a legal referendum on independence to settle the issue.