MADRID (Reuters) - Spain’s opposition parties have scored their first victory against newly reinstated Prime Minister Mariano Rajoy, paralyzing an education bill, in a taste of the challenges he will face in his second term.

Spanish Prime Minister Mariano Rajoy gestures as he arrives for first cabinet meeting after winning a parliamentary confidence vote for a second term ending 10 months of political paralysis that included two inconclusive elections, at the Moncloa Palace in Madrid, Spain November 4, 2016. REUTERS/Sergio Perez

After two inconclusive elections, Rajoy now leads Spain’s weakest minority government and will have to piece together support in a hostile and fragmented parliament to pass laws and, most pressingly, design a budget for 2017.

The Socialists and smaller centrist party Ciudadanos enabled Rajoy to have a second term in a confidence vote last month but have said they will fight his policies and may form ad-hoc majorities to legislate against his conservative People’s Party (PP).

Lawmakers voted late on Tuesday to freeze the implementation of an education law Rajoy’s party passed when it had an absolute majority in the previous legislature and which included an unpopular new exam regime.

“Today we start to reverse the most damaging policies of the PP,” Socialist politician Antonio Hernando told reporters before the vote in parliament.

Rajoy has offered to sit down with rivals in the coming months to reach a cross-party agreement on education, but on Wednesday he cautioned them not to put an economic recovery at risk by overturning reforms such as a labor market overhaul.

“They were good for Spain and what works should not be changed,” he told a conference in Madrid.

NEED TO NEGOTIATE

Opposition lawmakers say Rajoy, who has led the PP since 2004, will have to make more of an effort to change his style, seen by many as aloof, to gain backing.

“The PP still thinks it has an absolute majority, psychologically it has to leave that behind,” said Pedro Azpiazu of the Basque National Party (PNV), whose support Rajoy hopes to gain for his budget.

Overturning laws will not be all plain sailing for the opposition however. Rajoy’s executive has the power to veto some motions before they progress through parliament if he can argue they affect the budget.

Parties can try and chip away at existing legislation with amendments, but repealing bills entirely entails coming up with alternative laws which Rajoy’s foes may struggle to agree on.

None agree on how to fix unemployment, which stands at the second-highest rate in Europe after Greece.

Aside from education, the PP’s foes have also teamed up to try and overturn an unpopular “sun tax” introduced by the last PP government and seen as penalizing households which produce their own solar energy.

If parliament continues to throw up obstacles to his government, Rajoy can threaten to dissolve it in May and call a new election, but opposition politicians doubt this would be in line with his style of governing.

“Rajoy is not known for making quick or dramatic decisions, but rather by favoring continuity,” said Miguel Gutierrez, a senior Ciudadanos politician.