Caretaker Prime Minister Mariano Rajoy welcomed the imminent formation of a new Spanish government, after the opposition Socialists agreed to end a 10-month political impasse and let him rule for a second term. Spanish government bonds rose.

King Felipe begins two days of consultations with party leaders in Madrid Monday, the start of a process that should see Rajoy’s People’s Party back in power within days. A first confidence vote may go ahead on Oct. 27 with a second round in which Socialists abstain taking place two days later.

“Soon we will have a government that is open to dialogue and understanding, that will uphold the law and make sure it’s upheld,” said Rajoy in a speech in the capital.

Spanish 10-year debt yields fell to the lowest level in more than a week, dropping three basis points to 1.08 percent as of 10:24 a.m. in Madrid. Stocks rose with the benchmark IBEX 35 index gaining 1.3 percent led by banks including Banco Popular Espanol SA and Banco Bilbao Vizcaya Argentaria SA.

Rajoy is emerging from Spain’s unprecedented deadlock with his grip on the government confirmed despite questions over how he’ll be able to take the country forward. He’s set to govern in a minority with just 137 deputies in the 350-seat parliament and his rivals have already demonstrated their willingness to vote together against the PP.

“Given the highly fragmented Parliament, the government is likely to struggle with further reforms and even with the passage of the 2017 budget,” Apolline Menut and Antonio Garcia Pascual, economists at Barclays Bank Plc in London, said in a research note Monday.

Socialists’ Dilemma

The Socialist federal committee voted Sunday that the party’s 85 lawmakers should abstain in a confidence vote this week to let Rajoy form a government, caretaker party leader Javier Fernandez said in a televised press conference on Sunday. All the group’s lawmakers should abstain with the aim of “unblocking the exceptional situation,” said Fernandez. Rajoy applauded the Socialist decision, describing it as “important” and “reasonable.”

Socialist officials have calculated that letting Rajoy lead a minority government is their least bad option, as its leaders wrestle with their worst-ever election results and the rise of the anti-establishment insurgents Podemos.

The Socialists had to choose between supporting Rajoy, a move that will undermine their credibility as leaders of the opposition, or triggering fresh elections with the party leadership in disarray after the ouster of ex-leader Pedro Sanchez this month. A new vote would see Podemos overtake the Socialists to become the main rival to Rajoy’s People’s Party, opinion polls show.

“The Socialist Party is trying to preserve the party system created in the late seventies,” said Ivan Redondo, a political consultant who has advised candidates from both main parties. “Refusing to reach a compromise would have meant Spain heading for a new party regime.”

Civil War Divisions

Although countries like Germany and Austria have often seen social democrats form alliances with conservatives, such compromises are unprecedented at national level in Spain, where the pain of the civil war in the 1930s still underpins the nation’s ideological divisions. While Rajoy’s PP was founded by Manuel Fraga, a cabinet member under Francisco Franco, the Socialist party was banned during the four decades of dictatorship.

The Socialists have been blocking Rajoy’s efforts to govern since June’s election created a divided parliament with no clear majority for the second time in six months. Their opposition began to crumble at the beginning of October when Sanchez resigned following an internal revolt against his attempts to knit together a multi-party majority including Podemos to keep Rajoy out.

The PP leader needs an outright majority in the 350-seat assembly to get through at the first attempt. In the second vote, 48 hours later, a simple majority is enough. In an earlier ballot last month, Rajoy mustered 170 votes.

Support for the PP rose to 38 percent in October compared with 33 percent in June’s election. The Socialists have slumped to 18 percent, trailing Podemos on 22 percent, according to a Metroscopia poll for El Pais published Oct. 16.