As the socialist-led government takes over in Spain, newly minted Prime Minister Pedro Sanchez faces at least two daunting tasks: cleaning up the wreckage wrought by years of European Union (EU) enforced austerity and resolving the Catalan crisis exacerbated by Madrid’s violent reaction to last fall’s independence referendum. Unfortunately, his Party’s track record is not exactly sterling on either issue.

Sanchez, leader of the Socialist Workers Party (PSOE), patched together parties in Catalonia and the Basque region, plus the leftist Podemos Party, to oust long-time Prime Minister Mariano Rajoy of the People’s Party (PP). But is the telegenic former economics professor up to the job, and will his Party challenge the economic program of the EU’s powerful “troika”—the International Monetary Fund, the European Central Bank and the European Commission?

The answers to those questions are hardly clear, and in many ways the cross currents and rip tides of Spanish politics still resemble Gerald Brenan’s classic study of the Civil War, The Spanish Labyrinth.

While the issue that brought Rajoy down was corruption—a massive kickback scheme that enriched scores of high-ranking PP members— his Party was already weakened by the 2015 election, and he has been forced to rely on the conservative Ciudadanos Party based in Catalonia to stay in power. In short, it was only a matter of time before he fell.

Sanchez promises to address the “pressing social needs” of Spaniards, although he has been vague about what that actually means. But Spain is hurting. While economic growth returned in 2013, unemployment is still at 16.1, and youth joblessness is 35 percent. Rajoy took credit for the economy’s rebound from the massive financial meltdown in 2008, but there is little evidence that budget cuts and austerity did the trick. The two main engines for growth were cheap oil and a weak currency.

The job growth has mainly been in short term and temp jobs, with lower pay and fewer benefits. That is not specific to Spain, however. Of the 5.2 million jobs created in the EU between 2013 and 2016, some 2.1 million of them have been short term, “mini” jobs that have been particularly hard on young people. Many continue to live at home with their aging parents, and 400,000 have emigrated to other European countries.

Education, health care, and infrastructure have all deteriorated under a blizzard of budget cuts, and Sanchez will have to address those problems. His party’s record on the economy, however, has been more centrist than social democratic, and the PSOE basically accepts the neo-liberal mantra of tax cuts, deregulation and privatization. It was PSOE Prime Minister Jose Zapatero who sliced more than $17 billion from the budget in 2010, froze pensions, cut child care funds and home care for the elderly, and passed legislation making it easier to lay off workers.

It was anger at the Socialists over rising unemployment that swept Rajoy and the PP into power in 2011. The PSOE has never recovered from that debacle, dropping from 44 percent of the vote to 24.9 percent today. It has only 84 deputies in the Parliament, just 14 more than Podemos.

When Podemos leader Pablo Iglesias proposed forming a government of the left. Sanchez rejected it and instead appointed all PSOE people to the cabinet. However, he will have to rely on support from the left to stay in power, and there is no guarantee that it will be there unless the Socialists step away from their centrism and begin rolling back the austerity measures.

Sanchez has a mixed record on leftism vs. centrism. He was ousted from the Party’s leadership last year by the PSOE’s rightwing when he considered forming a united front of the left. It was the Party’s rank and file, angered at the rightwing Socialists that allowed Rajoy to form a minority government that put him back in power. So far, Sanchez has been unwilling to consider the kind of alliance of left parties that has been so successful in Portugal.

The new government will also need the support of the two Catalan parties, and that will likely be an uphill slog. The Catalans just elected a government that supports independence, although its President, Quim Torra has called for “talks.”

The current Catalonia crisis was ignited when Rajoy torpedoed a 2006 agreement between the Spanish government and the Catalan government that would have given the province greater local control over its finances and recognized the Catalan’s unique culture. Under the prodding of the PP, the Constitutional Court overturned the agreement and shifted the dispute from the political realm to a legal issue.

At the time, the idea of independence was marginal in Catalonia, but the refusal of Rajoy to even discuss the issue shifted it to the mainstream. “Independentism, which until 2010 was a decidedly minority option in Catalonia, has grown immensely,” according to Thomas Harrington, a Professor of Hispanic Studies at Trinity College, CT.

The Catalans began pressing for a referendum on independence—nearly 80 percent supported holding one—although it was initially seen as non-binding. Even though Podemos did not support the idea of independence, it backed the basic democratic right of the Catalans to vote on the issue. The PSOE, however, was as hard-nosed on the issue as Rajoy and the PP. Not only did the Socialists not support the right of the Catalans to vote, they backed Rajoy’s crackdown on the province, although they decried the violence unleashed on citizens trying to vote during last October’s referendum.

Some 2.3 million Catalans out of the 5.3 million registered voters went to the polls and overwhelmingly endorsed independence in spite of the fact that Rajoy sent some 10,000 National Police and Guardia Civil into the province to seize ballot, beat voters and injure more than 850 people. Legal procedures have been filed against over 700 mayors and elected officials, and the Catalan leadership is either in jail or on the run. While Sanchez said the crackdown was “a sad day for our democracy,” he will have a lot of explaining to do to the Catalan government.

Unlike Rajoy, Sanchez says he wants a dialogue with the Catalans, although he also says he intends to uphold the Spanish constitution, which does not permit secession.

Catalan society is deeply split. The big cities tend to be opposed to independence, as are many trade unions. The left is divided on the issue, but many young people support it. As the Financial Times’ Tobias Buck points out, “The younger generation, who have been schooled in Catalan and have less contact with the rest of Spain than their parents, are among the most enthusiastic backers of independence.”

It is also clear that the brutality of Rajoy’s assault has moved people in that direction, although polls show independence still does not have a majority. But in a sense, that is irrelevant. When almost half the population wants something that “something” has to be addressed, and if Buck is right about the demographics, time is running out for Madrid.

There are other serious constitutional issues that need to be addressed as well. Rural areas are greatly favored over cities. While it takes 125,000 voters in Madrid to elect a representative, in some rural areas it takes as few as 38,000.There is also a need to address Rajoy’s draconian laws against free speech and assembly.

Just how stable Sanchez’s government will be is unclear. He must keep the Basques and the Catalans on board and do enough on the economy to maintain the support of Podemos.

The PP is badly wounded, and the rightwing Ciudadanos Party—the only one that voted against the no confidence resolution—will be looking to fill that vacuum. Ciudadanos calls itself the “center,” but its economic policies are the same as those of the PP, and it is rabidly opposed to separatism. It performed poorly in the last election and in regional elections in Galicia and the Basque region. It did well in the recent Catalan elections, but that is because the Popular Party collapsed and its voters shifted to Ciudadanos.

Sanchez must recognize that the Catalan issue is political, not legal, and that force is not an option. As Napoleon Bonaparte’s Foreign Minister Talleyrand once remarked, “You can do anything you like with bayonets, except sit on them,” summing up the truism that repression does not work in the long run.