The European Commission has confirmed that the Catalan independence referendum was “not legal” under Spanish law.

It described the vote, which saw police beat protesters and shut down polling stations, as an “internal matter” and suggested it would not heed calls to intervene.

“This is an internal matter for Spain that has to be dealt with in line with the constitutional order of Spain,” a spokesperson said.

“If a referendum were to be organised in line with the Spanish constitution it would mean that the territory leaving would find itself outside of the European Union.

“Beyond the purely legal aspects of this matter, the Commission believes that these are times for unity and stability, not divisiveness and fragmentation.”

The European Commission, which is the executive of the EU, called for all sides to “move very swiftly from confrontation to dialogue”.

Pro-Catalan protesters gather in Madrid square

In what appeared to be a reference to police brutality against voters, a statement said “violence can never be an instrument in politics”, adding: “We trust the leadership of Prime Minister Mariano Rajoy to manage this difficult process in full respect of the Spanish constitution and of the fundamental rights of citizens enshrined therein.”

The referendum has no legal status after being blocked by the Madrid government and Constitutional Court for being at odds with the 1978 constitution, which states that Spain cannot be broken up, and there is little sign of support for Catalan independence in any other part of Spain.

Catalan leaders had called for the EU to intervene following clashes that injured almost 900 people on Sunday, including two in a serious condition.

The United Nations had called on Spanish authorities to respect the Catalan people’s rights to freedom of expression, assembly and participation in the vote, and to exercise the “utmost restraint”.

But footage showed voters being beaten with batons and dragged away from polling stations as dozens were shut down.

Riot police fired rubber bullets as they smashed their way into centres and confiscated ballot boxes in footage that sparked widespread condemnation.

Nicola Sturgeon said she was concerned by the images, adding: “Regardless of views on independence, we should all condemn the scenes being witnessed and call on Spain to change course before someone is seriously hurt.”

Pro-independence protesters clash with the Civil Guard outside a sports centre doubling as a polling station in Girona (EPA)

The Belgian Prime Minister, Charles Michel, tweeted: ”Violence can never be the answer! We condemn all forms of violence and reaffirm our call for political dialogue.“

“We urge all parties to exercise the utmost restraint and avoid violence of any kind.”

Catalan officials said 90 per cent of voters had chosen to leave Spain, but Madrid disregarded the result after declaring the referendum illegal and repeatedly vetoing independence.

Jordi Turull, the Catalan government’s spokesman, accused police of breaking agreements struck with the local security council but said the heavy-handed response had “encouraged us even more”.

“The State has tried to crack down on democracy,” he added. “It was like holding a referendum in the middle of a dictatorship.”

The Catalan President, Carles Puigdemont, hailed a “moment of great importance” for the region and praised the “courage and bravery” of voters.

Catalonia independence referendum: Riot police clash with voters Show all 17 1 /17 Catalonia independence referendum: Riot police clash with voters Catalonia independence referendum: Riot police clash with voters A man faces off Spanish Civil Guards outside a polling station in Sant Julia de Ramis Reuters Catalonia independence referendum: Riot police clash with voters Riot police form a security cordon around the Ramon Llull school in Barcelona EPA Catalonia independence referendum: Riot police clash with voters Riot police evict a young woman during clashes between people gathered outside the Ramon Llull school in Barcelona EPA Catalonia independence referendum: Riot police clash with voters Spanish Civil Guard officers break through a door at a polling station in Sant Julia de Ramis Reuters Catalonia independence referendum: Riot police clash with voters Spanish National Police clash with pro-referendum supporters in Barcelona on Sunday AP Catalonia independence referendum: Riot police clash with voters Crowds raise their arms up as police move in on members of the public gathered outside to prevent them from voting in the referendum at a polling station where the President Carles Puigdemunt will vote later today Getty Catalonia independence referendum: Riot police clash with voters People confront Spanish Civil Guard officers outside a polling station Reuters Catalonia independence referendum: Riot police clash with voters Three man hold each other as they try to block a Spanish police van from approaching a polling station AP Catalonia independence referendum: Riot police clash with voters A woman shows a ballot to a Spanish Civil Guard officer outside a polling station Reuters Catalonia independence referendum: Riot police clash with voters A man wearing a shirt with an Estelada (Catalan separatist flag) and holding carnations faces off with a Spanish Civil Guard officer Reuters Catalonia independence referendum: Riot police clash with voters Police try to control the area as people attempt to cast their ballot at a polling station in Barcelona Getty Catalonia independence referendum: Riot police clash with voters A man is grabbed by officers as police move in on the crowds Catalonia independence referendum: Riot police clash with voters Two women argue with a Spanish National policeman during clashes between Catalan pro-independence people and police forces at the Sant Julia de Ramis sports centre in Girona EPA Catalonia independence referendum: Riot police clash with voters Sant Julia De Ramis in Spain Getty Catalonia independence referendum: Riot police clash with voters Confrontation outside a polling station in Barcelona, where police have tried to stop people voting AFP/Getty Images Catalonia independence referendum: Riot police clash with voters A Spanish National Police officer aims a rubber-bullet rifle at pro-referendum supporters in Barcelona AP Catalonia independence referendum: Riot police clash with voters Riot police clashed with voters as polls opened in Barcelona Sky News

The leader accused Spanish authorities of an “absolute denial of reality…and evident hostility” towards Catalonia’s long-standing aspirations of independence.

Oriol Junqueras, the Catalan Vice President, said Catalonia had “won its right to be a new Republic, if this is what the Parliament decides”, with the local government counting more than 2 million “yes” votes and 176,500“no” out of 2.26 million counted ballots.

Mr Rajoy, the Spanish Prime Minister, is facing the country’s biggest constitutional crisis in decades if Catalonia moves for secession.

He offered to call all-party political talks to “reflect on the future” of Catalonia, but maintained his outright rejection of independence as an option

“I propose that all political parties with parliamentary representation meet and, together, reflect on the future we all face,” the Prime Minister said in a televised address.

He has the constitutional power to sack the regional government and put Catalonia under central control pending fresh elections.