BARCELONA/GIRONA, Spain (Reuters) - Twenty-four hours after Spain removed him from power, Catalonia’s leader had resolved to leave the country and take his independence campaign to the heart of the European Union, but first he needed to tie off an important loose end.

FILE PHOTO: Sacked Catalan leader Carles Puigdemont attends a news conference at the Press Club Brussels Europe in Brussels, Belgium, October 31, 2017. REUTERS/Yves Herman/File Photo

Carles Puigdemont’s secessionist alliance was threatening to unravel, with the region’s biggest grass-roots independence organization unhappy about his plan. So he called a meeting of political allies on the eve of his departure for Brussels, according to three sources with first-hand knowledge of the events.

In the rural hamlet of Vilahur, near Puigdemont’s home town, he and seven others, including the deputy chief of the grass-roots Catalan National Assembly (ANC), met over dinner at a farmhouse in the expectation Puigdemont and others present would be arrested for rebellion within hours, one source said.

Puigdemont told the group he was not running away from a fight, as ANC officials feared it would be perceived, and that he would use Brussels, home to the EU parliament and commission, as a stage to continue to speak out against Spain’s crackdown on the independence movement, the source added.

After adjourning for the night, the group resumed the next morning at the farmhouse and agreed to back his plan. Crucially, that plan also included a commitment to contest snap regional elections called by Madrid for Dec. 21 rather than boycott them as the ANC first envisaged.

On reaching agreement, Puigdemont told them he was prepared to “spend 30 years in prison” for the cause and the others embraced him in what the source described as an emotional farewell. ANC deputy leader Agusti Alcoberro was among them.

The account of the meeting reveals how the independence movement’s leadership managed to overcome deep-rooted internal divisions and agree a rough game plan for the weeks ahead. While the two main pro-independence parties finally chose on Tuesday to contest the elections under their own brand rather than a joint ticket, their manifestos will be coordinated and they are still expected to join forces after the vote.

An opinion poll this week showed that pro-independence parties would win the largest share of the vote, though a majority was not assured and question marks remain over Puigdemont’s leadership of the pro-independence cause. Puigdemont could not be reached for comment.

WRONG-FOOTED

At the time of the Vilahur talks, Prime Minister Mariano Rajoy seemed to hold the upper hand. He had surprised the secessionists by calling elections much sooner than they had expected, according to sources close to Puigdemont.

A disparate collection of parties whose only common thread is independence, Puigdemont’s coalition had been bickering over what some saw as his timid tactics. Some had even been talking of boycotting the election, which could have spelled the end of the movement.

“He was wrong-footed by Rajoy’s tough response,” said an ally of Puigdemont.

When Rajoy dropped his election bombshell, Puigdemont was still celebrating the regional assembly’s vote earlier that day to declare Catalonia a republic.

The Catalan leader had to move quickly to secure consensus for the Brussels plan and, more importantly, for his unwieldy coalition to contest the elections, which had been called by a nation they no longer considered themselves to be a part of.

In Puigdemont’s first meeting late on Oct. 27, in Barcelona’s regional parliament building, the coalition decided that only a few ministers would go with him to Brussels and the rest would stay and defend themselves against any prosecution for sedition, said sources briefed on that meeting.

Afterwards, he drove to Girona, the town he had run as mayor. In a courtyard of a government building, he filmed a message calling for non-violent opposition to Rajoy’s takeover of the region. It was televised by Catalan public broadcaster TV3 which called him “president”.

Later, he lunched with his wife and two friends at a local wine bar and walked with them to Girona’s Placa de la Independencia (Independence Square) where he posed for photos while applauding onlookers shouted “Long Live Catalonia”.

Despite the defiant scene, the day was not going well for the newly declared Catalan republic.

Rajoy was receiving backing from world powers including France, Germany and the United States. Spanish authorities were already taking over Catalan government offices.

THE FLEMISH CONNECTION

However, Puigdemont got some news that appeared to justify his Brussels strategy just as he and four of his ex-ministers were making their way there.

Belgium’s migration minister, Theo Francken, said that if Puigdemont were to seek political asylum in Belgium, it would be “not unrealistic” to grant it. Belgium is one of few EU states where EU citizens can request asylum.

Francken belongs to Flemish nationalist party N-VA, which is supportive of Catalan self-determination. He said no asylum request had yet been made but events were “moving fast”.

Puigdemont was meanwhile in a friend’s car heading for Marseilles, southern France, where he would board a flight to Brussels. To elude Spanish police, someone drove his official car in a different direction.

Since arriving in Brussels, Puigdemont and the four ex-ministers who accompanied him there have been slapped with European arrest warrants for rebellion and sedition, crimes carrying up to 30 years in jail.

Back in Spain, eight other ex-ministers have been jailed pending an investigation and potential trial for rebellion, sedition and misuse of public funds.

Puigdemont has not sought asylum but is at liberty in Belgium pending a hearing on extradition, which his lawyer has said he will oppose.