Manu Fernandez, Associated Press
Protestors demonstrate in the center of Barcelona, Spain, Sunday, June 19, 2011. The rally, one of many nationwide protests, was held to demonstrate against Spain's economic crisis and alleged political corruption.

MADRID — Spanish lawmakers approved new labor reforms on Wednesday to make wage negotiations more flexible, in a narrow victory for a government fighting to lower sky-high unemployment and regain the confidence of wary investors.

The reforms are designed to shake up 30-year-old laws governing how unions and employers negotiate wages and other working conditions. The government acted after four months of talks between the two sides collapsed. Parliament will now start debating possible amendments.

Prime Minister Jose Luis Rodriguez Zapatero, who runs an increasingly weak minority government, got the package of reforms through the lower chamber of Parliament only after frantic negotiations with small regionally based parties, which ultimately abstained from voting.

That gave Zapatero a simple majority, all he needed because the package was presented as a decree.

Spain has so far avoided a debt crisis like the one afflicting several smaller eurozone countries, but many economists say it is not out of the woods yet.

Legislative approval of the collective bargaining changes came a day after the International Monetary Fund urged Spain to press ahead with more job-market reforms aimed at cutting its high unemployment rate — 20.7 percent as of the end of April according to the EU and 21.3 as of the end of the first quarter, according to the Spanish government.

Economists say the old system is rigid and particularly harmful as Spain fights to overcome recession and desperately needs to create jobs, raise tax revenue and ward off fears it might be the next EU country to need a bailout.

The vote was 169 in favor and 159 against, with 20 abstentions. The only 'yes' votes came from Zapatero's party.

Both unions and business groups have found something to complain about the government's reforms.

The CEOE, Spain's main business federation, is unhappy with a clause that stipulates that when a collective pay deal expires, its terms will remain in effect for up to 14 months while a new one is renegotiated.

Unions, meanwhile, complain about reforms giving businesses greater flexibility, such as having employees do longer shifts when the workload demands it and shorter ones when business is slow.

The changes are seen as the final plank of a reform package Zapatero was forced to enact under pressure from the EU and international financial organizations over the past year. During that time, Spain fought to overcome recession and quell fears that its deteriorating public finances would require it to take a Greece-style bailout.

Zapatero has already cut government spending, frozen pensions, raised the retirement age and made it easier and cheaper for companies to lay people off.

Spain slipped into recession in 2008 after a real estate bubble burst and along with it, a credit-fueled consumer spending spree vanished. The economy is growing again — although just barely — but the jobless rate has risen relentlessly, more than doubling since 2007.

Zapatero's Socialists trail conservatives badly in the polls and Zapatero has said he will not seek a third term in general elections that must be called by March 2012. His party was trounced in municipal and regional elections last month.