German carmaker Volkswagen and its labor unions have agreed to 30,000 job cuts by 2021 at its VW brand as part of a plan to boost profitability and fund a shift to electric and self-driving cars after its emissions scandal, a source told Reuters Friday. Europe’s largest automaker is trying to increase savings at its biggest unit in Germany, where its costs are high, while finding billions of euros to pay for the cleanup related to its diesel emissions cheating scandal. The agreement, details of which are to be announced at a news conference at Friday morning, foresees 3.7 billion euros ($3.9 billion) in annual savings at VW’s namesake brand, which will involve 23,000 job cuts in Germany alone, another source said. VW Group, which has 610,076 employees worldwide, declined to comment. The so-called future pact, which the two sides have been negotiating since June, aims to increase the brand’s operating margin from an expected 2 percent this year. Labor leaders agreed to the cuts in exchange for a management pledge to create new jobs and invest in electric cars, mainly at factories in Germany. At the same time as cutting traditional jobs, the VW brand will create 9,000 new jobs through investments in electric car technology, the source said. VW managers have agreed to build an electric sports utility vehicle at the company’s main plant in Wolfsburg and a smaller electric vehicle, known as the I.D., in the eastern German city of Zwickau, the first source said. Electric motors will be built in Kassel, and VW will start battery cell production in Salzgitter. It will build full battery packs at its plant in Braunschweig, the first source said. German newspaper Handelsblatt reported earlier that up to 30,000 jobs would be cut by 2020 to save up to 4 billion euros. It also said some 10,000 jobs would be axed outside of Germany, mainly in North and South America.