By Belén Carreño
MADRID (Reuters) - Just last year, Spain's struggling prime minister said he would not be able to sleep at night had he made a pact with the hard left Unidas Podemos party to secure power.
Now, Pedro Sanchez' new best friends are the once-radical movement, born out of anti-austerity "indignados" protests, who have enabled him to retain the premiership and joined him since January in Spain's first coalition government in decades.
Once avowedly anti-establishment Podemos leaders stood in the front row to applaud the King of Spain in parliament this month and sit down weekly with members of Sanchez' Socialist Party at meetings nicknamed "matins" for morning prayers.
"We are living a sweet moment," one Socialist leader told Reuters, acknowledging surprise at the harmony, albeit still in early honeymoon stage, between the erstwhile rivals.
After years of political instability and repeated elections in Spain, the coalition's early optics and concrete policy progress have soothed worries around the European Union and in the financial community of the bloc's fourth largest economy.
But the partners do not agree on everything, coalition sources stressed. So without a parliamentary majority, their so-called "pact of the hug" could be strained in looming negotiations with Catalan separatists and conservative opposition parties whose cooperation is needed for reforms.
FIRST TEST PASSED
Some fear the unlikely coalition could eventually unravel, as happened recently in Italy.
For now, though, and despite a history of personal animosity between Sanchez and Podemos leader Pablo Iglesias - who previously avoided eye contact and seldom talked - there have been no rows and the junior coalition member is toeing the line.
That enabled them to pass their first major test earlier this month, agreeing on a multi-year fiscal framework that envisages a reduction of the deficit and debt.
"Unidas Podemos wants to launch measures that involve a lot of spending, and it is true that it's going to be difficult because of budgetary restrictions," a Podemos member of government told Reuters. "But we have accepted that the broad figures that have been put forward are the right ones."
Embryonic tensions on issues from immigration to sexual crimes reform have been swiftly quelled by Iglesias, whose past criticism of the Socialists has given way to reassurances.
"In Spain, there is going to be a united and firm government," he said last week.
Sources on both sides described a tight-knit communication system and regular meetings to deter in-fighting. Chief of staff Ivan Redondo and Unidas Podemos communications director Juanma del Olmo have been pivotal to that, the sources say, while former Socialist premier Jose Luis Zapatero is also providing Iglesias with advice.
While last year Iglesias complained Sanchez would not even call him on his mobile, now the deputy prime minister lunches one-on-one with him every two weeks at his boss's residence, sources close to Sanchez said.
The early Monday morning "matins" meetings between senior members of both parties set the agenda for the week and iron out disagreements, officials said. And at a government retreat in the countryside, the cabinet shared a cake for a Unidas Podemos minister's birthday, one participant said.
The party that once voiced the anger of the streets over the financial crisis is clear about its turn towards mainstream.
"If to raise the minimum wage or to make a comprehensive law to protect the sexual freedom of all people we have to applaud the head of state, obviously we are going to do it without any doubts," said Irene Montero, a Podemos minister.
Just a year earlier, the same Podemos lawmakers, then in opposition, had pointedly stayed seated as the king spoke.
"It is good to have them in government rather than exerting pressure from the outside," a top Spanish banker told Reuters.
A senior EU source said the bloc's institutions were also relieved. "We want Spain to have a government, any government," the source said, referring to the destabilising string of four parliamentary elections in four years.
How long the harmony can last may depend on restive Catalonia. Separatist party Esquerra Republicana de Catalunya (ERC) is already conditioning its approval for the budget on talks to address the region's independence drive.
Podemos was traditionally more open to separatists' demands than the Socialists - in particular accepting the idea of a referendum - but have now said they will stand behind Sanchez who opposes that.
The government also needs the support of the conservative People's Party to make senior appointments in major institutions like the Constitutional Court, which will not be easy.
Broad support is also required for labour and pension reforms.
"For now we can talk about positive surprises," said a Socialist source close to Sanchez. "But difficult times may lie ahead in the coming months."
(Reporting by Belén Carreño; Additional reporting by Paola Luelmo; Editing by Ingrid Melander and Andrew Cawthorne)