MADRID?Mariano Rajoy takes office for a second term as Spain's prime minister this week, overcoming a 10-month leadership impasse but heading a minority government with little maneuvering room to enact legislation.

Mr. Rajoy, who was re-elected by parliament on Saturday night, faces pressing economic and fiscal challenges that he and his fellow lawmakers put aside while they were consumed by political gridlock. At stake is whether Spain can keep up the momentum that has made it the eurozone's fastest-growing large economy.

The 61-year-old conservative takes office with the least parliamentary support of any leader since Spain returned to democracy following the death of dictator Francisco Franco in 1975. Mr. Rajoy will struggle to achieve consensus among lawmakers who have spent most of the past year excoriating each other as morally corrupt and unfit to govern.

"We have survived 300 days of a caretaker government, but we could not survive a government that doesn't govern because it lacked support or was overcome by obstacles," Mr. Rajoy told parliament on Saturday, saying he was open to compromise. Mr. Rajoy is set to be sworn in on Monday and appoint his cabinet on Thursday.

The country has been without a fully empowered government since elections last December and again in June produced fragmented parliaments, with party leaders unable to agree on a majority coalition. Mr. Rajoy, whose Popular Party finished first in both elections but lost the majority it had won in 2011, remained as a caretaker, unable to initiate legislation.

Parliament's vote to re-elect Mr. Rajoy was 170 to 111, with 68 abstentions. He got his own party's 137 votes plus 32 from the centrist party Ciudadanos and one from a coalition representing the Canary Islands.

The abstentions came from the Socialist party, which had repeatedly blocked Mr. Rajoy's election but reversed a week ago. In Spain, voters choose among political party slates to elect a parliament, which then chooses a prime minister.

Mr. Rajoy's re-election elicited animosity inside and outside the parliament building. Thousands had gathered to protest his reappointment and some protesters tossed objects at lawmakers who had supported Mr. Rajoy as they were leaving the building.

Mr. Rajoy's party will govern alone, without the assured support of any others. But officials of the party said they hoped to assemble a one-vote majority on important legislation by making deals with Ciudadanos and three regional parties from the Basque Country and the Canaries?a lineup that would gather 176 of parliament's 350 votes.

That would allow the government to make some headway on closing Spain's budget gap, lowering the country's 19% unemployment rate and bolstering funding to the public pension system.

Such measures, however, would probably fall short of the structural overhauls economists say are needed to boost long-term growth. Spain's economy is expected to expand by more than 3% this year, more than other major European economy, but slow to 2.3% in 2017.

Mr. Rajoy's first major task is to pass a budget, but he would be hard pressed to find allies if his party's hoped-for 176-member alliance doesn't hold together. The other 174 members of parliament represent the Socialists, three other leftist parties and the conservative regional party whose leadership of Catalonia's independence drive has put it at odds with the prime minister.

The Socialists, while allowing Mr. Rajoy to take office, are eager to defend their status as the main opposition party and stanch the defection of many of their supporters to Unidos Podemos, a far-left coalition with 14 fewer seats in parliament.

"What we can't accept are additional cutbacks to the welfare state," said Socialist party economic leader Pedro Saura, who believes the Popular Party would try to make such cuts to close the budget deficit. The two parties' "positions are rather far apart," he added.

The deals Mr. Rajoy strikes with his potential allies on the budget will determine whether his government raises some taxes or cuts spending?or both.

Some economists are skeptical that Mr. Rajoy will be able to substantially narrow the budget deficit, which last year exceeded European Union limits. Spain faces a loss of some of its EU funding unless it shrinks the deficit to 3.1% of gross domestic product in 2017, from an expected 4.6% this year; that would require around ?5.5 billion in extra revenues or spending cuts, economists estimate.

"You have a budget problem and you don't have a government withenough power to implement the measures they need to," said Á ngel Talavera, an economist at Oxford Economics.

Write to Jeannette Neumann at jeannette.neumann@wsj.com

(END) Dow Jones Newswires

October 30, 2016 21:55 ET (01:55 GMT)

Copyright (c) 2016 Dow Jones & Company, Inc.