The Japanese carmaker guaranteed in a statement there would be no mass layoffs until that date, and in exchange production at the plants will resume in late August.

Workers have been on strike since early May, a few weeks before Nissan announced the decision to leave Barcelona as part of a global turnaround plan.

The UGT union leader at Nissan, Javier Hernandez, said the plants should gradually resume output starting Aug. 24.

The factories, which employ around 3,000 workers and indirectly an additional 20,000, were originally due to close by the end of this year, but Nissan said recently it was open to postponing that to give more time for authorities to find another company interested in the units.

There has been no new information on potential companies interested in the plants once Nissan leaves, Hernandez said.

The company also announced a voluntary redundancy and pre-retirement plan for workers.

"We think this is the best solution for all parties ... as it buys more time to seek alternative re-industrialisation projects, and if those fail to materialise, offers exit conditions well above the maximum legally established limits," Nissan's chief negotiator, Frank Torres, said.

By Joan Faus