(Bloomberg) -- The Catalan separatist party holding the key to unlocking a national government for Spain is preparing its supporters for the possibility of a deal that would put acting Prime Minister Pedro Sanchez back in power.

While the leaders of Esquerra Republicana haven’t yet decided to give Sanchez the votes he needs, they’ve already started meeting with local groups in order to minimize the potential backlash if they do eventually back a Socialist-led administration, two party officials said. In exchange for their support, Esquerra wants Sanchez to engage directly in talks over the future of Catalonia, the officials said, asking not to be named discussing party strategy. Contact between the two sides has been minimal so far, they added.

So Spain’s future hinges on the unpredictable politics of its most troubled region. Two years after the illegal referendum that put Catalonia on the front pages of newspapers around the world, the region has been roiled by violent demonstrations again over the past month after separatist leaders were jailed for their part in the attempt to force a split with the rest of the country.

Sanchez, 47, could be hit by another curve ball in the middle of his coalition negotiations if a court in Barcelona decides to ban Catalan President Joaquim Torra from holding public office for stoking the protests. The court ruling due in the coming weeks could trigger a regional election in Catalonia, or Torra could call a snap vote to maintain some control of the situation.

The Socialist leader is trying to stitch together a governing majority after this month’s general election left the parliament split between five main national parties. Last week, Sanchez signed an agreement with the anti-establishment group Podemos, and he’s likely to also get the backing of a clutch of minor parties. But Sanchez still needs the 13 lawmakers from Esquerra to take power.

Podemos has supported Catalan calls for a ballot on whether to leave Spain while insisting it would campaign against a split. When it comes to the national government, it’s leaving the negotiations in the hands of Sanchez.

The question of what to do with Catalonia has been wreaking havoc in Spanish politics since an illegal referendum in 2017 triggered weeks of protests, a shambolic declaration of independence and ultimately a crackdown by Madrid. Esquerra’s leader, Oriol Junqueras, was sentenced to 13 years in jail last month for his part in the uprising.

Junqueras and his associates realize that they’ll get a far better hearing if Sanchez’s Socialists are in power rather than the conservative People’s Party, who would be reliant on the far-right group Vox. But they are also wary of being outflanked by Torra’s party, which has taken a more extremist approach to the issue of independence.

Torra struck a defiant tone when he appeared in court Monday, saying that he knowingly disobeyed an order to remove pro-independence symbols from public buildings in the region. A regional election would bring their tussle into focus, making it more costly for Esquerra to support Sanchez.

Esquerra is willing to drop its headline demand for a referendum on independence -- a move that Sanchez has categorically ruled out -- but wants to see the premier engage directly in talks. The leadership won’t accept him sending proxies such as his coalition partner Podemos instead, because they feel they’ve been let down by Sanchez too many times, the officials said.

An initial meeting between Catalan and Socialist officials in Madrid left Esquerra disappointed because the Socialists brought no concrete proposals to the table, the officials said.

To contact the reporter on this story: Rodrigo Orihuela in Madrid at rorihuela@bloomberg.net

To contact the editors responsible for this story: Ben Sills at bsills@bloomberg.net, Robert Jameson

©2019 Bloomberg L.P.