By Andreas Cremer

BERLIN (Reuters) - Volkswagen <VOWG_p.DE> and two of its parts suppliers on Tuesday resolved a contract dispute that had hit output at more than half of the carmaker's German plants and threatened to undermine its recovery from a diesel emissions scandal.

After more than 20 hours of negotiations that went on through the night, VW said it had settled its differences with CarTrim, which makes seats, and ES Automobilguss, which produces cast iron parts needed to make gearboxes, but gave no details. The suppliers confirmed an agreement had been reached.

The conflict had threatened VW's profitability following last year's diesel emissions test cheating scandal and also risked hurting hundreds of other VW suppliers.

The suppliers were seeking compensation for lost revenue they said ran into tens of millions of euros after VW canceled a contract.

The dispute affected about 28,000 workers at six of VW's 10 German factories on Monday when the automaker halted production of the top-selling Golf and Passat models, as well as assembly of engines, gearboxes and emissions systems.

VW said on Tuesday the suppliers had agreed to start delivering parts again and the affected plants would gradually resume production.

The new deal will see the suppliers working with VW for at least another six years, and VW will also be able to source part of its needs from other suppliers over that time, German paper Sueddeutsche Zeitung reported in an advance copy of an article to be published on Wednesday.

VW was not immediately available for comment on the report.

ES Automobilguss said it had agreed a "long-term partnership" that would secure more than 400 jobs at the company.

Still, the German deal did not extend to differences between suppliers and VW's Brazilian unit, which said it had broken off supply contracts after nearly a dozen failed renegotiations and was going to court to recover its machinery.

Faced with billions of euros of costs from its emissions scandal, VW had previously indicated it would seek price cuts from its suppliers.

Lower Saxony Economy Minister Olaf Lies, a member of VW's supervisory board, had said the dispute was hitting VW "at the worst possible time". Whether VW management should face questions for over-reliance on single suppliers needed to be clarified, he added.

Analysts at UBS estimated a one-week production halt at VW's Wolfsburg headquarters would result in about 100 million euros ($113 million) in lost gross profit, and could have knock-on effects on other suppliers.

OTHER SUPPLIERS SUFFER

Pressure had been growing on both sides to resolve the dispute, with Germany's economy ministry warning of the broader impact on jobs.

Five hundred companies that supply parts for the Golf were being forced to build up inventories because the carmaker was not buying, according to the German Association of Supply Chain Management, Procurement and Logistics.

In addition, VW's customers face delays in the delivery of new cars, which could prompt them to cancel purchase contracts and switch to other brands.

"The consequences for the entire supply chain are already considerable today," Christoph Feldmann, managing director of the association, said in a statement.

There could be a silver lining for VW in limiting Golf output, however. The automaker had already canceled Golf production shifts on Oct. 4-7 and Dec. 19-22 due to falling demand.

VW said the stoppages were part of regular production adjustments.

"Given the slowdown of VW sales (excluding China), the brand certainly needs to slightly trim production levels," said London-based Evercore ISI analyst Arndt Ellinghorst.

($1 = 0.8829 euros)

(Additional reporting by Maria Sheahan, Jan Schwartz and Brad Haynes; Editing by Mark Potter and Jonathan Oatis)