Spain is in crisis, and its prime minister appears to be in denial. The run-up to Sunday’s referendum on independence for Catalonia made it clear that the country was in trouble. But neither those arranging it nor those rejecting it can fully have anticipated the scenes at polling stations: police in riot gear beating peaceful protesters with batons, dragging voters out by the hair or throwing them down stairs, firing rubber bullets to disperse crowds – even striking at Catalan firefighters and jostling with Catalan police.

The immediate result of the violence was hundreds of casualties by mid-afternoon, according to Catalan authorities, and at least 11 wounded officers, according to the central government. The wider effect is the shock expressed well beyond Catalonia, and Spain. The outcome is almost certain to be that some of the Catalans indifferent or opposed to secession – until now, at least, the majority – are pushed into the arms of the cause. Who wants to be ruled by a state like this, many are asking.

Yet Mariano Rajoy’s response, in his address to the nation, was simple: there was no referendum and no problem – police acted with “firmness and serenity”. The responsibility for all that had happened lay with the Catalonian government. Spain is paying for his determination to stop the illegal vote by the bluntest means and at all costs. His latest remarks are only likely to inflame matters.

Catalan nationalists owe him much of their success in recent years. The Spanish financial crisis fuelled a surge in the independence movement, leaving many in the wealthy region feeling they were paying more than their fair share. But the shift in the public mood was spurred on when the constitutional court trimmed back a charter increasing the region’s powers – and already approved by the Spanish parliament – after a challenge by Mr Rajoy’s People’s party.

Even so, support for independence peaked in 2013, at an estimated 49%. Catalan nationalists, who hold only a wafer-thin majority in the regional parliament, pushed the legislation for Sunday’s vote through it against considerable opposition; Catalans who wanted to remain in Spain were unlikely to vote. The Spanish constitutional court ruled it illegal and called for it to be halted. But Mr Rajoy’s heavy-handed response furthered the cause of secessionists again.

The central government seized 10m ballot papers; arrested key officials; dismantled the technology to connect voting stations, tally votes and vote online; blocked and removed voters from polling stations; and confiscated ballot boxes. Catalan officials told voters to print off ballot papers at home and said they could vote wherever they wanted. Whatever they may claim, the results are neither legally nor morally binding: whatever votes are tallied cannot truly represent Catalonia’s wishes. Between them, the two sides have produced both a vote that is hugely contentious and a result that is meaningless.

The prime minister’s address, made as condemnations of violence arrived from Jeremy Corbyn, the Belgian prime minister and the EU’s Guy Verhofstadt – though most member states sought to stay out of the affair – is likely to fuel nationalists’ accusations of authoritarianism and complaints about the suppression of the Catalan will.

But if Catalan leader Carles Puigdemont was right to say that the Spanish state had “lost much more than what it had already lost”, his assertion that Catalonia had won is at best half true. Most Catalans wished both for a referendum and to remain in a united country. They have been ill-served by both the state and the independence movement. Mr Verhofstadt urged de-escalation, a negotiated solution bringing in all parties – including the opposition in Catalonia – and respect for Spain’s constitutional and legal order. He is right. Finding a way out of this mess will require a willingness to listen, to Catalans most of all.