In 2009 the Nissan factory in Barcelona in northeastern Spain seemed condemned to close.
But it was saved thanks to labour rights sacrifices, becoming a symbol of "flexisecurity" - a cooperative approach to labour relations in which employees accept a degree of flexibility in working arrangements -- which is being held up as an example to follow in France even as it remains the focus of debate in Spain.
Production at the plant plunged from 197,000 vehicles in 2007 to 44,000 vehicles in 2009.
Then no new orders arrived.
"We had to react, become competitive and flexible," the vice president of Nissan in Spain, Frank Torres, told AFP.
Employers and employees reached an agreement to allow for a longer work day and lower salaries for new hires and in exchange the plant received orders to produce five new models of vehicles.
"If we had not accepted, we would have had 2,000 colleagues turned out in the street," said Enrique Saludas, the head of the main union at the factory, which employs 3,500 workers.
Similar measures were adopted in the entire auto sector, which accounts for ten percent of Spain's economic output. The country's total motor vehicle production rose by 11.1 percent last year.
Weakens workers' rights
The cornerstone of this policy was a labour market reform adopted in 2012 by acting Prime Minister Mariano Rajoy's conservative Popular Party government.
At the time the unemployment rate stood at 22.5 percent after 2.6 million jobs were lost during the past four years of economic crisis.
The reform created a new open-ended contract which can be used by small and medium sized businesses for employees who are under the age of 30 which allows dismissals without justification during the first year of employment.
It also drastically reduced the amount of compensation that must be paid when workers are let go and allows for collective dismissals, even when a firm is not facing economic difficulties.
The reform also weakens workers rights, such as a prohibition on unilaterally changing work conditions.
Four years later the reform - which triggered a general strike - remains controversial.
Socialist leader Pedro Sanchez vowed to revoke the reform when he took the helm of the party in June 2014.
But the party has softened its stance since it allied itself with new market-friendly party Ciudadanos last month following an inconclusive December general election.
"Your pact does not defend workers. You have left the door open to lowering the cost of dismissals," the head of new far-left party Podemos, Pablo Iglesias, said Wednesday in parliament as he announced his party would vote against Sanchez's big to form a government.
'Work becoming more precarious'
"The goal of this reform was to create jobs but what it has achieved in fact was make it possible to fire workers at will," said labour lawyer Ramon Hernandez Carrera.
Labour law flexibility has been pursued in other nations in Europe as well. In Germany a plan introduced in 2005 by a Social Democratic government encouraged so-called "mini-jobs" - short-term contracts which are exempt from tax and social charges if they pay workers less than €450 a month.
"Every day the global economic market requires greater flexibility, we can't oppose this reality," said Jordi Garcia Vina of Spanish business association CEOE.
After Spain returned to growth in 2014, the country began to create jobs - over a million in two years, the vast majority short term contracts.
The unemployment rate registered a record fall last year, dropping nearly three percentage points to 20.9 percent, although it still remains the highest rate in the eurozone's after Greece's.
"Unemployment is falling but the price is that work is becoming more precarious. Lower salaries are offered and much more is demanded from the worker," said Beatriz Toribio, spokesman for Infojobs, Spain's main employment website.
Between 2011 and 2014 the average salary in Spain rose by 2.1 percent to €1,881 ($2,042) while inflation rose 5.2 percent. The percentage of contracts that pay less than the monthly minimum wage of €752 rose during this period to 13 percent from eight percent.
The labour market reform is "unfair and a failure", said Antonio Ferrer of Spain's UGT union, who points out the jobless rate remains high.
A study by Spanish bank BBVA defends the reform, arguing if it had been adopted earlier, in 2008, it would have prevented the destruction of one million jobs.
By Daniel Bosque / AFP