Catalonia's bid for independence from Spain explained
The drive for Catalan independence captured the world's attention in October, when a banned referendum on the issue was met with a heavy police crackdown.
A bid by Spanish Prime Minister Mariano Rajoy to quash the efforts of separatists by calling an election backfired in December.
Pro-independence parties returned with a majority in the regional parliament. But their determination to reinstate their controversial leader and pursue a split from Spain has brought the two sides to an impasse.
It is the country's biggest political crisis since democracy was restored in 1975, after the death of military dictator General Francisco Franco.
How did we get here?
Catalonia is one of Spain's wealthiest and most productive regions and has a distinct history dating back almost 1,000 years.
Before the Spanish Civil War it enjoyed broad autonomy but that was suppressed under Gen Franco.
When Franco died, the region was granted autonomy again under the 1978 constitution and prospered as part of the new, democratic Spain.
A 2006 statute granted even greater powers, boosting Catalonia's financial clout and describing it as a "nation", but Spain's Constitutional Court reversed much of this in 2010.
The 2008 financial crash and Spanish public spending cuts fuelled local resentment and separatism.
There is a widespread feeling that the central government takes much more in taxes than it gives back.
But the complexity of budget transfers makes it hard to judge exactly how much more Catalans contribute than they get back from investment in services, such as schools and hospitals.
Following a symbolic referendum in November 2014, outlawed by Spain, separatists won the 2015 regional election.
Catalonia's pro-independence leaders then went ahead with a full referendum on 1 October 2017, which was also declared illegal by Spain's constitutional court.
Organisers said 90% of voters backed a split. But turnout was only 43% amid a boycott by unionists.
The sight of Spanish national police beating voters, and politicians being jailed, revived disturbing memories, for some, of the Franco dictatorship.
In a febrile atmosphere the separatist majority in the Catalan parliament declared independence on 27 October.
Using the Article 155 emergency powers, Madrid dissolved parliament, sacked its leaders and called a snap election for 21 December.
Some argue that if Madrid makes concessions, such as restoring parts of the 2006 autonomy statute, it could defuse the crisis.
How much support is there for independence?
The regional election result was a landmark in the nationalists' long campaign for independence. It proved - legally - the strength of support for their cause.
Although pro-independence parties won 47.5% of the popular vote, this translated into 70 seats in the 135-seat Catalan parliament.
With just two seats two fewer than their previous total, they have a slim majority.
The success came despite the ousted Catalan President Carles Puigdemont campaigning via self-imposed exile in Belgium, and several other pro-independence politicians being held in jail.
- Catalan political landscape as divided as ever
- Catalonia - history, politics and religion
- The man who wants to break up Spain
However, the Citizens (Ciudadanos) party, or Cs, actually got the biggest share of the votes and wants Catalonia to remain united with Spain. So it will be a powerful voice, whatever happens. But analysts believe Cs would struggle to form a viable governing coalition.
So will Catalonia become independent?
Possibly, but certainly not for a long time. First comes the difficult task of forming a Catalan coalition government.
The three separatist parties have struggled to form one, with their main leaders either in prison or in self-imposed exile.
There is an ideological split between Mr Puigdemont's JxCat and the left-wing separatists of CUP.
JxCat (Together for Catalonia) won the most votes among the separatist parties, and Mr Puigdemont is the only candidate to be Catalonia's president.
But he faces arrest on charges of sedition and rebellion if he returns to Spain.
His supporters say he could rule Catalonia remotely, something that has been repeatedly dismissed by Madrid.
PM Rajoy has warned that any attempt to inaugurate Mr Puigdemont will lead to the continuation of emergency rule by Madrid.
His conservative Popular Party (PP) had a disastrous election, winning just three seats.
The direct rule he imposed in October is supposedly temporary, but for the time being he will keep control of the region.
If the separatists do ever manage to split away, it would be hard for Catalonia to win recognition internationally.
New states mostly emerge from situations where ethnic groups have been victims of genocide or other major human rights abuses.
Kosovo was a huge humanitarian crisis for Europe - even so, many countries refuse to recognise it as independent.
What does the crisis mean for the country?
Catalonia has its own language and distinctive traditions, and a population nearly as big as Switzerland's (7.5 million).
It is also a vital part of the Spanish state, locked in since the 15th Century.
Barcelona has become one of the EU's best-loved city-break destinations, famed for its 1992 Summer Olympics, trade fairs, football and tourism.
Catalonia is one of Spain's wealthiest regions, making up 16% of the national population and accounting for almost 19% of Spanish GDP.
Generations of people from poorer parts of Spain have moved there for work, forming strong family bonds with regions such as Andalusia.
During this crisis, the Catalan economy has suffered. Thousands of businesses, including major banks and energy firms, have moved their headquarters out of the region.
The EU has treated the crisis as an internal matter for Spain, deaf to the separatists' pleas for support.
However, there have been warnings that the issue is damaging Spain's democratic credentials.
The Economist Intelligence Unit, which compiles an influential annual democracy ranking, said Spain risked being downgraded from a "full democracy" to a "flawed" one over its handling of the situation.