The police attacked at dawn, storming into schools, smashing the doors of community centres, dragging out women and old people and clubbing resisters.

I arrived at one voting centre to find people covered in blood and screaming, trying to come to terms with what had just happened. A young man showed me wounds from being shot with rubber bullets.

"They are fighting against us like 300 years ago," another said in disbelief. "It's a crazy, crazy situation."

I've covered wars and civil conflicts all over the world but this was different.

It wasn't Gaza or Chechnya or the Congo — it was Barcelona, one of the most popular tourist destinations in Western Europe and a world showcase of art and culture. It was also my adopted home.

Catalans with "Estelada", or independence flags, gather during the 2017 Catalan National Day in Barcelona. ( AP: Emilio Morenatti )

That night I was doing back-to-back live interviews with the ABC answering questions like "Could there be another civil war?" and wondering how a city of so much beauty and hospitality and love of life could suddenly feel like a war zone.

I haven't stopped wondering.

A quiet life interrupted

In 2016, after a decade of constant long-haul travel from Sydney, I moved to Spain for three years to be closer to where I spent most of my time.

I chose Barcelona after freelance journalists told me it was one of the most practical cities to be a foreign correspondent — half the price of living in London and a hub for cheap international flights.

La Sagrada Familia cathedral at the heart of Barcelona. ( Foreign Correspondent )

It was also relatively peaceful — a place to work between assignments rather than a story in itself — and without the huge time-zone differences of Sydney.

I moved into the old town in the district of La Ribera, at the far edge of the tourist swarm around the Ramblas. It is the city's traditional artisan quarter, with twisting alleyways full of craft shops, small bars, antiquarian bookshops and community libraries.

I shopped at the local farmers' market each day, practising my rudimentary Spanish, and followed local politics with the passing indifference of someone unlikely to ever cover it.

Sometimes, as I lay awake at 2:00am listening to the local Moroccan drug dealers shouting at their Central American rivals, or the squeals of Essex hens' nights punctuating the screams of tourists chasing pickpockets, I wondered if I'd made a mistake.

Eric Campbell moved to "magical" Barcelona to quietly get on with his work as a journalist. ( Foreign Correspondent: Brietta Hague )

But mostly, I started each day thinking how lucky I was to be able to live here.

My apartment overlooked the Catalan Palace of Music, one of the jewels of modernist architecture, where a dishevelled homeless singer would wake the neighbourhood with a street-side aria. My cobblestoned street led straight into the heart of the medieval centre.

As anyone who has visited Barcelona knows, it's one of those rare cities that seems to have been sprinkled with magic.

But in 2017 tensions were increasing with the central government in Madrid over independence. The regional government, headquartered in Barcelona and dominated by separatists determined to split from Spain, announced it would hold a referendum on October 1 in defiance of the Constitutional Court.

In the days before the referendum, I saw thousands of national police taking up positions around the city. But I was as shocked as anyone by the force they used to stop it happening.

'Occupied Catalonia'

Space to play or pause, M to mute, left and right arrows to seek, up and down arrows for volume. Watch Duration: 2 minutes 18 seconds 2 m 18 s Creating human towers, or castells, are part of Catalan tradition ( Foreign Correspondent )

Outsiders may think of Barcelona as Spain's second largest city. But most locals think of it first as the capital of Catalonia, a region with its own language, culture and history.

The sense of Catalan identity isn't just parochial. Much of the community views Catalonia as an entirely separate country enduring three centuries of occupation by the Castilian region around Madrid.

Esther Oriol says she feels 100 per cent Catalan rather than Spanish. ( Foreign Correspondent )

Esther Oriol has spent her whole life in Barcelona but insists she is Spanish in name only. "I feel 100 per cent Catalan. I don't feel Spanish at all," she said.

She's also a keen "castellera", training twice a week to form the human towers known as "castells".

Every few weeks her team fronts up to a neighbourhood town square far away from tourists and competes with other clubs in what looks like insanely dangerous climbing, scrambling up each other's shoulders to form a human pyramid up to five storeys high.

She told me how much she was looking forward to her two-year-old daughter Laia taking part, but most of all she wanted her to see an independent Catalonia.

"I hope that my little girl will live in a free country when she gets older, but I'm not able to find an easy solution," she said.

I've met as many Barcelonans who think it would be madness to split from Spain. But all feel the sting of history that underpins the independence movement.

From the 1930s to the 1970s Barcelona endured the horrors of civil war and far-right dictatorship. The nationalist general Francisco Franco imposed a brutal regime across Spain, executing Catalan nationalists and banning regional customs and languages. Even Catalan names like Laia were forbidden.

But the historical grievances go back even further.

Barcelona's 9/11

Graffiti in Barcelona depicts the 1714 defeat of Catalonian resistance to the Spanish. ( Foreign Correspondent )

Ask a Catalan why they deserve their own country and it's likely the first date they'll mention is 1714.

"It was the moment that all the Catalan institutions were banned by the Spanish empire," a friend, Jordi Rivera told me. "Since then, things have never been the same for Catalans."

Like many Catalans, Jordi Rivera looks back on September 11, 1714, as a day of national disaster. ( Foreign Correspondent )

Before 1714, Catalonia was a self-governing nation. It was technically part of Spain thanks to a royal marriage, but the kings in Madrid knew to leave the rich and fiercely independent Catalans alone.

They ran their own trading empire across the Mediterranean, spreading their language as far as France, Sardinia, Andorra, and the Balearic Islands of Majorca and Menorca. Some still refer to south-east France as "northern Catalonia".

It all ended when the Catalans unwisely backed the losing side in a war of succession to the Spanish throne. On September 11, 1714, Barcelona fell to the winning side after a long and bloody siege. And while it happened 305 years ago, it continues to be thought of as Catalonia's 9/11.

"We are still feeling the consequences of losing that battle," Mr Rivera said.

An etching depicts the Spanish defeat of Catalonia. ( Foreign Correspondent )

Every September 11 Barcelona holds a day of commemoration for the defeat called La Diada, with one million people taking to the streets waving Catalan flags. In recent years it's been increasingly co-opted by separatists waving the one-starred independence flag, and even dressing their pets in it.

Every home match of FC Barcelona at Camp Nou stages a bizarre memorial to 1714. At 17 minutes and 14 seconds the crowd starts chanting "in, inde, independencia".

'Independence would be a disaster'

Independence supporters draped in the Catalan flag. ( Foreign Correspondent: Brietta Hague )

The colour and passion of the "independentistas" can mask the fact that, as in a football match, there are two equal and opposing sides. Opinion polls suggest Catalans are almost evenly split over independence.

The internationally minded business community is particularly angry at how the doomed referendum ushered in months of turmoil and disruption.

Jose Luis Bonet, president of the winemaker Freixenet, which now owns part of Coonawarra, said independence would be "a disaster for Catalonia, a disaster for Spain and a disaster for the EU".

But part of the impetus for separatism is financial. Catalonia is a relatively rich part of Spain and many resent their taxes going to prop up poorer regions. Many Spanish point out that Catalonia made its wealth partly on the backs of people from poorer regions coming to work in its factories.

If there is a clear majority position on anything, it's that Catalans want to have a say.

About 80 per cent believe the central government should allow them a binding referendum. But even if they were given the chance, only the national parliament could change the Spanish constitution to allow Catalonia to secede.

The major national political parties insist that will never happen. So the movement continues to simmer with plenty of resentment and no obvious resolution.

FC Barcelona is one of Catalonia's most internationally renowned brands. ( Foreign Correspondent )

It would be wrong to suggest that a city that attracts 9 million tourists a year is a powder keg. The overwhelming majority of people keep their passions in check, and no matter how strongly people feel everybody has friends and relatives from other parts of Spain and they all have to get along.

Just don't tell Catalans their culture is Spanish.

Dags and devils

Space to play or pause, M to mute, left and right arrows to seek, up and down arrows for volume. Watch Duration: 1 minute 51 seconds 1 m 51 s Celebrations take place outside the Sagrada Familia in Barcelona ( Foreign Correspondent )

I wasn't prepared for how different Catalonia is to the rest of the country.

Franco pushed the myth of a unitary Spanish culture of bullfighting, flamenco and paella. But Catalonia banned bullfighting nine years ago citing animal cruelty, and restaurants mainly serve defrosted paella to tourists (Catalans eat a noodle-based variant called fideua).

Few can dance the hyper-sensual, gypsy-infused flamenco of the Spanish south. The Catalan national dance sardana, in which people stand in a ring holding hands while quietly stepping left and right, makes morris dancing look sexy. The folk music could be best described as a medieval variant of Kenny G.

That's not to say Barcelona doesn't have an amazing local culture. Amid the daggy music and dancing is a kaleidoscope of community festivals staged in neighbourhoods throughout the year.

"Gigantes" puppets are a uniquely Catalonian cultural tradition seen at festivals in Barcelona. ( Foreign Correspondent )

Giant puppets called gigantes roam the back streets carried by local volunteers. Quirky bands wander through the Saturday markets. And nothing can prepare you for the stunning but little-known festival of Correfocs, meaning "fire run".

It's staged around the city's biggest tourist drawcard, the unfinished Sagrada Familia cathedral, with "devils" lighting fireworks on "dragons".

But not a single tourist sees it because the locals wait until the tour groups have departed. I was able to take part in a fire run during my last weeks in Barcelona, one of those wonderful expat moments when you feel you're finally experiencing the real city.

Despite being part of Spain, Catalonia has banned bullfighting. Barcelona's La Monumental stadium once hosted the fights. ( Foreign Correspondent )

I was even able to put on one of the 55-kilogram dragon models. A local organiser, Albert Riudeubas, explained the festival was based on a medieval religious tradition.

A dragon at the Correfocs festival. ( Foreign Correspondent: Deborah Kee Higgins )

"The dragons represent the evil in people, and they go out in the streets to chase people and then they finish in Sagrada Familia cathedral where good beats evil," he said.

In other words, a 21st century pagan celebration.

It reminded me of the cracker nights I experienced as a kid before our nanny state banned them, except this was 10 times better and twice as dangerous.

Kids jumping into the sparks, devils shooting flames, drummers and dancers and revellers and dragons and the ghostly backdrop of Antoni Gaudi's ethereal Sagrada Familia.

Right now, as the city ends its summer hibernation, people are bracing for the announcement of prison terms for the organisers of the independence referendum. It's possible the city will once again explode into mass protests.

But my strongest memories will be of those times of celebration rather than the tensions of politics.

Barcelona is one of the most extraordinary, beautiful and passionate cities you could ever hope to live in. I'll miss her deeply.

Watch Homage to Barcelona on Foreign Correspondent tonight on ABC TV at 8:00pm and iview