In its first reaction a day after scores were hurt in clashes in Catalonia, the European Commission said the referendum was "not legal" under Spanish law and was an "internal matter" for Spain.
An independent Catalonia would also have to leave the EU if it did vote for independence in a legal referendum, European Commission spokesman Margaritis Schinas said.
"Beyond the purely legal aspects of this matter, the commission believes that these are times for unity and stability, not divisiveness and fragmentation," Schinas said in a statement to reporters.
"We call on all relevant players to now move very swiftly from confrontation to dialogue. Violence can never be an instrument in politics.
"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."
Spain said Monday it will do "everything within the law" to prevent Catalonia from declaring independence, a day after Catalonia's regional government declared victory in the referendum.
"Under the Spanish Constitution, yesterday's vote in Catalonia was not legal," Schinas added.
"For the European Commission, as President (Jean-Claude) Juncker has reiterated repeatedly, this is an internal matter for Spain that has to be dealt with in line with the constitutional order of Spain.
"We also reiterate the legal position held by this Commission as well as by its predecessors -- 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."
Later EU President Donald Tusk on Monday urged Spain's prime minister to avoid further "use of force" in the Catalonia crisis, after a banned independence referendum was marred by scenes of police violence.
Just spoke to @MarianoRajoy. Sharing his constitutional arguments, I appealed for finding ways to avoid further escalation and use of force.— Donald Tusk (@eucopresident) October 2, 2017