Elections in Catalonia have failed to clarify the region's immediate future, exposing a split between those for and against independence from Spain.
The Spanish government called the snap election after Catalan separatist parties unilaterally declared independence in October, following a referendum deemed illegal by authorities in Madrid.
Spain's government dissolved the regional assembly, arrested some of its leaders and dissolved the Catalan parliament. Here is a look at the outcome of Thursday's ballot:
The pro-Spain Ciutadans (Citizens) collected the most votes in what was the biggest electoral triumph so far for the party founded just over 10 years ago.
Ciutadans, led by 36-year-old lawyer Ines Arrimadas, has been the main opposition to the pro-independence movement in Catalonia.
However, it was a bittersweet victory for the business-friendly party because its 37 seats in the 135-seat regional assembly are not enough for it to form a regional government on its own.
The real winners were the pro-independence groupings, who together have a majority in the new Catalan parliament.
:: Who lost?
Spanish prime minister Mariano Rajoy's conservative Popular Party came last with just three seats, down four, in what was a major blow to the country's governing party.
Mr Rajoy argued that the unrest in Catalonia over its October bid for independence had hurt the economy in Spain's richest region, accounting for about one-fifth of the country's national income. By appealing to their pockets, Mr Rajoy had hoped Catalans would turn against the separatists.
The Citizens party, emboldened by its strong showing in Catalonia, could become a stronger challenge for the Popular Party on a national level.
:: Who will take power?
Parties demanding independence won 70 seats, giving them a parliamentary majority, though they did not get as many seats as they did in the last election two years ago.
The separatists' slim parliamentary majority will allow them to negotiate the formation of a government - although past squabbles between them suggest it will not be easy.
Together For Catalonia snared 34 seats, making it the most popular separatist party. Its leader is Carles Puigdemont, the fugitive former Catalan president.
He campaigned from Belgium, where he is evading a Spanish judicial probe into the October attempt to split from Spain. The investigation could lead to charges of rebellion and sedition that carry penalties of decades in prison if he returns to Spain for a possible trial.
The left-wing republican ERC party collected 32 seats. Its leader and Mr Puigdemont's former number two Oriol Junqueras is being held in jail near Madrid while the investigation continues. The radical, anti-capitalist CUP has four seats.
Questions remain over which person from those three parties might become Catalan president, what conditions the parties would each impose on each other, and what they will seek from Madrid.
:: What about Spain?
The elections kept alive the turbulent issue of Catalan independence, which has scant support in Spain.
The likely continuing political unrest and uncertainty is unwelcome for investors if the early market response on Friday is anything to go by. The Madrid stock exchange slid 1.6% at the open but soon recovered to trade only 0.9% lower in late morning trading.
Investors "are wisely taking a little risk off the table" after seeing the Catalan result, ETX Capital senior market analyst Neil Wilson said.
Spain's central bank last week blamed the uncertainty in Catalonia for its decision to cut its national growth forecasts for next year and 2019 to 2.4% and 2.1%, respectively.
:: What about the jailed or absent separatists?
Eight of the separatist figures elected, including Mr Puigdemont and Mr Junqueras, are either in jail or are fugitives from Spanish justice in Brussels following October's secession bid.
By law, they can formally accept their seats as deputies without being present. However, parliamentary rules do not allow fugitive or jailed MPs to vote in absentia. That means that unless their status changes, the eight may have to renounce their seats and pass them on to other party members.
Otherwise, the separatists would be short of the majority necessary to elect a new government and pass laws in the regional assembly.
:: What's the new timetable for Catalonia?
Mr Rajoy is expected to announce the date of the inaugural Catalan parliament session in the coming weeks, but rules say that it will need to be before January 23.
At that opening session, the parliament will choose a house speaker who will call on a candidate to try to form a government within 10 days. The first investiture vote for a new Catalan president must be held by February 6.
In that first vote, the candidate needs an absolute majority of votes. If the candidate fails, he or she will have another chance within 48 hours when they need to have only more votes in favour than against. Failing that, the parties will have two months to form a government or fresh elections will be called.
Governing Catalonia, meanwhile, will remain in the hands of central authorities in Madrid, until a new Catalan cabinet is chosen.
Mr Rajoy has not ruled out invoking the constitutional article that allows him to seize control of the region if the new government breaks the law again by seeking unilateral independence.