I’m not sure what country I woke up in this morning. I mean that both literally and figuratively. Not only is Catalunya’s future as a region of Spain seriously in doubt after Sunday’s referendum on independence, so is the very notion of what country Spain is trying to be.

The battle seen on the city streets and village cobblestones across northern Spain this weekend has been brewing for years now, a protracted game of chicken played by the central government and the country’s wealthiest region. Both sides paid lip service to the idea of dialogue, but made it clear that neither would budge an ideological inch in whatever discussion might ensue. For the independence-minded Catalan government, that meant anything short of a binding referendum would be rejected; for Spain, any path forward that entertained the possibility of an independent Catalunya was a non-starter.

But of the few paths Prime Minister Mariano Rajoy and the central government had going into Sunday’s vote, they clearly chose the worst. By taking a rigid stance against the referendum, they allowed the Catalan government to frame the vote not simply as one for independence, but for the sanctity of democracy in general. Every other action taken by the Spanish government in the past two weeks fanned the flames of an already-explosive situation: parking a cruise ship filled with 7,000 federal police in the Barcelona port; shutting down websites related to the referendum; arresting government officials and seizing ballot boxes by force.

It was no longer an issue of Catalunya versus Spain, but of democracy versus fascism

All of this played perfectly into the Catalan government’s preferred narrative: a brave, self-determined region with a fever dream for freedom going up against the obstinate Goliath still addicted to Franco-era repression. By the time the polls opened on Sunday morning, it was no longer an issue of Catalunya versus Spain, but of democracy versus fascism.

As independentistas came out in masse to vote, I spent the day walking the streets of Barcelona. What I saw was a body of people desperate to have their voices heard. Young kids draped in Catalan flags, singing the songs taught to them by grandparents who fought for the right to sing them. Families huddled in tents pitched inside of schools to ensure they couldn’t be forced out by police. At Escola Cervantes, a voting station in the heart of the Born, more than a thousand people filled the streets surrounding the school, waiting for hours to cast their votes. As the first voters, a 90-year-old couple locked arm in arm, emerged from the ballot box and onto the street, a chorus of cheers erupted across the barrio.

Hours later, I returned just as the polls were closing. A police helicopter hovered forebodingly over the crowd. The separatists are by no means the only faction in Catalunya—polls in recent months showed a majority of people living in Catalunya favored remaining in Spain. But the heavy hand of the Spanish government on voting day served to unite, on the streets at least, a divided population. As the helicopter lingered, the Catalans—families, couples, little kids on tricycles—cocked their heads to the sky and chanted. As the last minutes for voting ticked off, a man came out on a balcony with a megaphone. “We need young people to come to the front to help.” Dozens of Catalans, young and old, came bounding forward, linking arms to form a human barrier around the entrance to the polls in case federal forces came to snatch away the ballot boxes. The police never showed up, and the Cervantes votes were counted without incident, but other parts of Catalunya weren’t so fortunate. Videos, photos, and testimonials teemed through social media showing a country at war with itself: women and children being ripped out of lines to vote; brigades of Catalan firemen, trying to protect their people, beaten by Spanish police; an entire village peacefully driving a force of armed police off their streets. In the face of a brutal attempt to stomp out the referendum, the Catalans behaved with extraordinary dignity and restraint.

Rajoy and his Partido Popular apparently aren’t intelligent enough to understand the modern world we live in, one where spontaneous images carry more weight than calculated speeches, where a single battered grandma can sway more minds than a dozen court decisions. And so it was that Spain woke up on Sunday with much of the political world behind it, and went to bed the shame of the international community.

The issue of Catalan independence has become as much a PR question as a political one. Knowing that Spain would never allow a clean break, the separatists’ primary hope has been to garner enough international support to pressure the Spanish government into allowing a binding referendum. In twelve hours of boot-stomps and nightsticks, Madrid did more to legitimize a call for independence than anything the Catalan politicians have done in recent years. By the end of the day, everyone from Belgium’s Charles Michel to Angela Merkel, politicians who had maintained a studied neutrality in the run-up to Sunday, released statements in support of the Catalans (if not yet their separatist ambitions).

As the polls finally closed and the votes were tallied, Rajoy stood smugly before the cameras and compounded the disasters of the day, thanking his security forces for their strong-armed enforcement of Spanish law and proclaiming his government’s reaction had been “an example for the world.” The newspaper headlines—Shame of Europe, Spain Torn Apart, Spain’s Day of Shame—and universal condemnations that soon followed turned Rajoy’s delusional proclamation into an uncomfortable truth: Spain had become an example for the world of how not to handle an independence movement.

But it needs to be stated very clearly: this is not all on Spain. The Catalan government has behaved less-than admirably in the run-up to the referendum, skirting parliamentary procedures, ignoring the Spanish constitution, and dismissing one court ruling after the next. As appalling and inexcusable as its actions were over the weekend, Madrid was very clear from the beginning that it would do whatever necessary to stop a referendum that the Spanish courts had deemed illegal. By encouraging its citizens to go out and vote, the Catalan government knew they were putting people in danger.

There’s no way around it: this is complicated calculus. Wrapped in this tragedy are a lot of larger questions about the nature of democracy, self-determination, and identity that will have a huge impact on Spain and the rest of Europe for years to come. I don’t know for certain what either side should have done to avoid this bloody stalemate, but I do know that on Sunday morning I was a firm opponent of Catalan independence, and by Sunday evening I was re-examining my allegiances. That’s how badly Spain fucked up.

The 1-O (October 1st) referendum was always more about 2-O. Nobody doubted that the people who showed up to vote in a referendum deemed illegal by the Spanish government would be overwhelmingly pro-independence, and the results bear that out. According to the Catalan government, 2.2 million people voted yesterday (42 percent of eligible voters) with a resounding 90 percent voting yes for independence. “The citizens of Catalunya have won the right to an independent state,” announced Carles Puigdemont, the leader of the Catalan government, shortly after the results came in. He’s since said that Catalunya would officially proclaim its independence from Spain within days, while Madrid has vowed to do everything in its power to stop that from happening.

Any way you look at it, Spain is unraveling at the seams

Now, the impossible question: What’s next? As I type this, Rajoy and other leading political figures are meeting in Madrid to determine how they can stop Catalunya from seceding. Puigdemont and the Catalans are gathered in Barcelona, planning the big independence announcement, with tens of thousands taking to the streets in support of the referendum results. Neither side looks willing to budge, and the European Union has said it will not intervene in Spain’s internal political matters. Talk of Article 155, wherein the Spanish government could step in and seize control of Catalunya, has been discussed, but this weekend proves just how explosive that option would be.

The most peaceful prospect would be a true, binding referendum in the coming weeks or months. Despite the polls showing deep ambivalence here toward Catalan independence, the Spanish government’s shameful behavior in recent days has potentially tipped the scales in the other direction. Knowing that, Rajoy is unlikely to get behind a referendum that could give Catalunya its independence. Any way you look at it, Spain is unraveling at the seams.

“We did what had to be done,” said Rajoy in his first public comments since the violence erupted. Eight-hundred and ninety-three people injured, families and friends racked by ideological fissures, and incalculable damage exacted upon the psyche of a beautiful but battered country: If this is what has to be done to keep this country together, then maybe Spain is more fragile than any of us believed.