Audi is to cut up to 9,500 jobs at its German factories by 2025 in order to save €6bn (£5.1bn) to invest in electric cars and digital technology.

The luxury carmaker, which is part of Volkswagen, said the job cuts were part of its mission to “become lean and fit for the future”. The company, which is based in Ingolstadt, Bavaria, said it would also hire 2,000 workers in “new expert positions in areas such as electric mobility and digitalisation”.

Audi’s chief executive, Bram Schot, said the cuts would make Audi more agile and efficient. “This will increase productivity and sustainably strengthen the competitiveness of our German plants.”

The job cuts, which equate to more than one in 10 of Audi’s total staff, come less than a fortnight after rival German luxury carmaker Mercedes-Benz said it intended to cut more than 1,000 jobs by the end of 2022 as it struggles to meet new tougher emissions targets.

“The company must become lean and fit for the future, which means that some job profiles will no longer be needed and new ones will be created,” Audi said in a statement. “The works council [“shop-floor” organisation representing workers] and the company’s management have agreed to cut up to 9,500 jobs until 2025. This will take place along the demographic curve – in particular through employee turnover and a new, attractive early-retirement programme. An equivalent percentage staff reduction will take place in management.”

Peter Mosch, chairman of Audi’s works council, said: “We have reached an important milestone: the jobs of our core workforce are secure. The extension of the employment guarantee is a great success in difficult times.”

Audi said it would produce 450,000 cars a year at its Ingolstadt factory, and 225,000 at its production facility in Neckarsulm, near Stuttgart. That means a reduction of about 40,000 cars at Ingolstadt, and an increase of about the same number at Neckarsulm.