BRUSSELS — Police officers in black RoboCop uniforms and Darth Vader helmets blocked ordinary citizens from voting. They beat people with batons, fired rubber bullets and wounded pensioners. All of it was captured by smartphones and news cameras and spread around the world.

It is the kind of violence the European Union would ordinarily condemn in high moral terms and even consider punishing. But that was not so easy this time. The nation in question was one of its own: Spain.

The Catalan situation has put the European Union and its members in an awkward position. The bloc defends the fundamental democratic rights of free speech and free assembly and of individuals to vote.

But while the European Union may be a union of democratic states, it is also, first and foremost, a union of sovereign states. It is wary of encouraging separatist forces that threaten to tear at many of the countries within it, as well as at the very fabric of the bloc.

The contradictions and relative quiet issuing from Brussels did not go unnoticed, especially by the Catalans, who are in favor of the European Union and say they would like to rejoin the bloc as an independent nation.

“The European Union cannot now continue to look the other side,” the leader of Catalonia, Carles Puigdemont, said around midnight Sunday, after declaring that Catalans had voted 90 percent in favor of a break with Spain.

On Monday, Mr. Puigdemont said that the European Commission, the executive arm of the European Union, “must encourage international mediation” of his region’s dispute with Spain.

That is not entirely likely. For Brussels, Catalonia is a matter for Spain, not for the European Union or its uncomfortable members.

The reason is simple. The Catalan vote was declared unconstitutional by Spain’s own courts, and in a time of rising nationalism and populism, the last thing that the European Union wants to do is to encourage regional separatism.

As with the 2014 referendum in Scotland, which unlike Catalonia’s vote was held with the blessing of the central government and where independence was rejected for now, member countries fear encouraging separatists at home: the Flemish in Belgium, the Lombards in Italy, the Corsicans in France, the Transylvanians in Romania.

With Britain lurching out of the European Union, there is little desire to sow even more economic uncertainty, legal disruption and moral confusion.

The president of the European Council of member states, Donald Tusk, said on Monday that he had called Spain’s prime minister, Mariano Rajoy, with support for his legal position, but urging him “to avoid further escalation and use of force.”

As a measure of the sensitivity toward regional separatism, even today, five of the 28 member states of the European Union — including Spain — do not recognize the independence of Kosovo, although NATO itself fought the Serbian effort to retain the territory. Nor does the European Union support independence for the Kurds or the Crimeans.

So the European Commission’s official position on Monday and reactions from European political leaders to the events in Catalonia were largely uniform and hardly surprising — Spain is sovereign, the referendum was illegal, but the violence was terrible and the parties should talk.

The violence — the brutality by the police and the use of rubber bullets against peaceful civilians trying to exercise their franchise — was no small matter. Even if what happened in Catalonia on Sunday hardly compares to the bloodletting in Bosnia, Kosovo or the Arab Spring, it still happened in a member state of the European Union.

“This is a P.R. disaster for Rajoy,” Steven Blockmans, an expert on European Union law and institutions at the Center for European Policy Studies in Brussels.

More than that, he said, Mr. Rajoy was fueling the independence debate by his clumsy response and deepening anxiety among his European colleagues.

Spain, he said, should look to his native Belgium, which has sharply devolved power to Flanders — much as Spain has already done with the Basque region.

“Belgium has met the desire for greater autonomy of Flanders through a process of ongoing constitutional reform,” Mr. Blockmans said. “No constitution is graven in stone.”

But Mr. Rajoy is also worried about the knock-on effect an independent Catalonia could have elsewhere in Spain. The Basque region fought for decades against Spain for independence through an armed rebel group called ETA, which was considered a terrorist organization, and its political wing, Herri Batasuna.

Like the Irish Republican Army, ETA finally agreed to lay down its arms, but the Basques won significant autonomy from Spain, including control over their region’s tax receipts — one of the major demands of the Catalan leaders. Such an example points to paths out of the current crisis, Mr. Blockmans said.

The European Commission is no longer regarded by the Catalans as a neutral mediator, he said. So that role might be taken over by the Venice Commission of international lawyers, part of the Council of Europe, a separate body from the European Union, but where all the bloc’s states are also members.

In any case, Mr. Rajoy, Spain and the Catalans need help to dig out from the hole they are in, he said. “Both sides are trapped in their own logic. Just as Rajoy needs to resume dialogue on constitutional reform, the Catalans should not push the extreme envelope and risk cutting off any further negotiations.”

Traditionally, the European Commission has followed the so-called Prodi doctrine, named after a former commission president from Italy, Romano Prodi — that a breakaway state would have to leave the bloc and could then be let back in only if it had gained independence in accordance with constitutional law in the member state it left.

Any new member state must enter with the unanimous agreement of all the others, so Spain would have a veto, but it would hardly be alone.

The current commission president, Jean-Claude Juncker, on Friday backed “the rule of law” and has said that Brussels must respect the decisions of the Spanish government and its constitutional court.
The commission has said several times that a vote in favor of Catalan independence would only be recognized if the referendum complied with the Spanish Constitution and was ruled to be legal.

Mr. Juncker has praised regional diversity but said that rich “regional traditions” should not become “elements of separatism and fragmentation of Europe.”

Where Brussels and many European capitals have remained silent, others have not. Belgium’s prime minister, Charles Michel, who governs in coalition with Flemish separatists, as well as the head of the European Parliament’s socialist parties, have both condemned the police action and called on Madrid to start a dialogue with the separatists.

“Violence can never be the answer!” Mr. Michel said on Twitter. His Slovenian counterpart, Miro Cerar, also said he was “concerned” and called for “political dialogue, rule of law and peaceful solutions.”

The European Parliament has also been solidly on the side of Spain. The Parliament is led by the European People’s Party, the center-right bloc to which Mr. Rajoy, Mr. Juncker and Chancellor Angela Merkel of Germany all belong.

Antonio Tajani, the Parliament’s conservative president, told a Catalan newspaper last week that to ignore Spain’s constitution was to undermine the legal basis for the whole European Union. “Those are the rules,” he said.

Still, Mr. Rajoy’s inept handling of the referendum will have a lasting impact, even if both sides eventually calm down and turn to further talks about enhanced Catalan autonomy.

As Charles Grant, director of the Center for European Reform, said on Twitter, whatever the rights and wrongs, the Spanish government “has lost the international PR battle through heavy-handed behavior.”