Polls have closed in the Spanish region of Catalonia, in an election seen as a litmus test of the separatist movement's legitimacy after it attempted to break away from Spain.
Madrid called the snap regional election with the hope of having a new government to deal with after Catalonia's Parliament in Barcelona declared unilateral independence in October.
Spain was plunged into its worst political crisis in decades when the Catalan government held an illegal referendum on October 1 on independence, triggering a monthslong standoff with Madrid.
Madrid responded to the Catalan administration provocations by firing the government, dissolving the region's Parliament and imposing direct rule.
Thursday's vote is being treated as a legal version of the referendum, and polls before the vote suggested it's on a knife-edge, with support for parties that are for and against independence split right down the middle.
Polls closed at 8 p.m. and the Catalan government reports an estimated turnout of above 80%, which would mark record participation if confirmed.
Results are expected late Thursday night.
What's going on?
The situation has made for an unusual campaign. Oriol Junqueras -- the president and head candidate of the main pro-independence Republican Left of Catalonia -- has run his campaign from prison in Madrid.
He has been charged with sedition and rebellion, and is facing a 30-year jail term over his role in the illegal referendum.
Carles Puigdemont, who led Catalonia until Madrid fired him, faces the same charges but fled to Brussels to campaign from afar. He leads the Junts per Catalunya (Together for Catalonia) faction and claims he is still the region's legitimate leader.
The two leaders, who ran the previous government together, have traded barbs in recent days, accusing one another of hiding from the independence fight, in a sign that movement is truly fractured.
The independence movement has sought to characterize the government in Madrid as a continuation of the dictatorship of Gen. Francisco Franco, which oppressed the Catalan people over four decades of rule.
It points to force used by Spanish police during the October 1 referendum, in which officers sent by Madrid to shut down the vote were seen pulling elderly people from polling stations, and firing rubber bullets and tear gas at protesters.
Madrid, on the other hand, has tried to portray independence leaders as rogue elements who have hijacked Catalan politics to promote a cause that does not have popular support.
Adding fuel to the fire, Spain's Deputy Prime Minister Mar-a Soraya S-enz de Santamar-a, given temporary command of Catalonia, declared at the weekend that the country's ruling Popular Party had "decapitated" the independence movement, Spanish media reports, stoking outrage in the region.
Who's leading the race?
According to Antoni Puigverd, a Catalan analyst with La Vanguardia, 1.5 million eligible voters were still undecided days before the election.
This volatility has to do largely with the fracture in the independence movement and the unusual circumstances of the vote, as Madrid retains control over the region and key independence figures are in prison or abroad, Puigverd said.
The outcome is expected to be messy. Catalonia's Parliament is typically split between seven parties and alliances, and no single one is expected to win a majority of the 135 seats.
This means the votes will almost certainly be followed by weeks of political wrangling, and the party that wins the most seats will not necessarily lead the government -- it is the biggest coalition that will ascend.
Some polls before the vote showed a meteoric rise in the center-right Ciutadans (Citizens) party, which is anti-independence, predicting it could win the highest number of seats, in a sign that there is appetite to end what the Catalans simply call "the process." The party is led by 36-year-old In-s Arrimadas, a relatively fresh face in Catalan politics.
The two main pro-independence parties appear to be at loggerheads, but they have insisted to CNN that, should they together win a majority of seats, they will form a coalition and show a unified front.
Some pre-vote polls show that they could achieve a narrow majority, while others show them falling just short.
If they do fall short, the smaller Catalunya en Com- (Catalonia in Common) could become kingmaker in a coalition. The party has said it will not team up with Ciutadans, but is also tepid on independence.
In the absence of a majority, who will become president will depend entirely on talks. Puigdemont was propelled into Catalonia's presidency in a last-minute deal after the previous vote in 2015.
Will the vote solve the problems between Barcelona and Madrid?
It's unlikely. The pro-independence parties together have a greater chance of forming a government, and if they do, the Madrid-Barcelona feud could be back to square one.
If they lose, Madrid is unlikely to show any mercy to the independence leaders in prison, according to Puigverd, the Catalan analyst.
"The situation will calm down and the independence movement will accept its defeat. They will expect clemency for their prisoners -- clemency that they won't get. The state will take its revenge, at least for a few years," he told CNN.
The push for independence is steeped in hundreds of years of history, but it was given new life in 2010, as the effects of the global financial crisis began to bite but also as Madrid began rolling back on the region's powers.
Spain's Popular Party -- which now governs the country -- challenged Catalonia's status as a country within Spain in the Constitutional Court in 2010 and won, forcing the region to accept a new status one notch down.
The Spanish Parliament has overturned several laws passed by Catalan MPs -- including one to protect poor people from soaring energy costs and another banning bullfighting. Each side accused the other of overstepping its authority.