Exiled Catalan separatist leader Carles Puigdemont looks set to regain power after regional elections, but what comes next is unlikely to be an easy ride.
Can he go back to Catalonia?
Mr Puigdemont was the target of an arrest warrant for his role in organising an illegal independence referendum on 1 October and leading the secession bid. He is now in Brussels but he faces arrest the minute he steps foot in Spain.
Seven of the 70 separatists elected are either in jail or in exile on allegations of sedition and rebellion. Unless they are released or they return home, they cannot vote in parliament to form a workable majority.
They could hope to be freed or have arrest warrants dropped if they swore not to pursue independence unilaterally.
That in turn could jeopardise support for a Puigdemont government from Catalonia's most vehement pro-independence party, the CUP.
Another option would be for these leaders to forfeit their seats and hand them to the next candidates on the list.
Mr Puigdemont cannot take absolutely for granted that he will be Catalonia's next president because the other two separatist parties, the CUP and ERC, have shown some reluctance to put him back at the helm. His party got more votes than the other two.
What's on the agenda?
Negotiations to form a government are likely to start following a Christmas break after 6 January.
Around the same date, conservative Spanish Prime Minister Mariano Rajoy will say when regional parliament will begin preliminary proceedings ahead of its first sitting. That process must start no later than 23 January.
Parliament must then vote by 8 February on putting a new government into place. By then, Mr Puigdemont should also clarify whether he will put himself forward as Catalonia president.
If no leader can command an absolute majority of the 135-seat regional assembly, a second vote will be held where a leader only needs a majority of votes cast in the chamber.
If that does not work, talks can go on for another two months. If they fail, parliament is dissolved and new elections are held.