VW was considering closing up to three factories in Germany and had been calling on its workforce to accept a 10% pay cut.
At the time, the union was calling for a 7% increase.
While the deal will also see a reduction in production capacity across its plants, it was celebrated by union leaders.
“No site will be closed, no-one will be laid off for operational reasons and our company wage agreement will be secured for the long term,” said IG Metall’s works council chief Daniela Cavallo.
“We have achieved a rock-solid solution under the most difficult economic conditions,” she added.
The 35,000 job cuts by 2030 are expected to be found through different solutions such as offered early retirement.
Under the agreement, a 5% wage increase that was previously agreed will also be suspended in 2025 and 2026.
The union said this would help “support transformation” at the company.
The number of apprenticeships on offer each year in Germany will be reduced from 1,400 to 600 from 2026 too, and it will look at shifting some production to Mexico.
It is also looking at alternative options for its Dresden and Osnabrueck sites.
But Oliver Blume, VW’s group chief executive, said in a statement that the agreement was “an important signal for the future viability of the Volkswagen brand”.
Factory closures in Germany would have been unprecedented in the manufacturer’s history.
VW, along with other German carmakers, has been badly affected by a decline in demand for its cars in China, previously a lucrative market.
At the same time, Chinese brands have been moving into Europe, increasing competition for sales.
During the talks, some 100,000 workers joined short, so-called “warning strikes” at sites across the country, in order to put pressure on the company’s management.
The latest round of talks began on Monday, with negotiators apparently determined to get matters settled before Christmas.
The German chancellor Olaf Scholz also welcomed the announcement, describing it as a “good, socially acceptable solution”.
Rachel Reeves headed into the parliamentary Christmas break on Friday with more bad economic news on her desk, as data showed the UK public finances in the curr
UK today accedes to CPTPP, a major trade bloc in the Indo-Pacific which includes countries like Australia, Vietnam, Peru, Chile and Malaysia. Wales
The UK’s debt bill fell last month as government borrowing dropped to just over £11bn, giving Rachel Reeves an early Christmas present after a furious backla
Retail sales rose 0.2% in November after a 0.7% fall in October, but the rise in sales at supermarkets was partly offset by a fall in clothing sales, the ONS sa