Daimler AG's Mercedes-Benz plans to spend more than 40 billion euros ($47 billion) this decade to develop electric vehicles and defend its position as the top luxury-car builder.

Outlining its blueprint for an all-electric future, the German manufacturer said it would, alongside international partners, build eight gigafactory battery plants as it accelerates the production of electric cars, according to Reuters.

However, Mercedes said it will only sell electric vehicles "where market conditions allow," implying that it may still sell gas-powered vehicles after 2030 in countries where demand for EVs are low.

Mercedes said it predicted half its sales as battery-only cars by 2025, up from a quarter in previous estimates. In the first half of 2021, these types of vehicles comprise 10.3% percent of the company's total sales.

Mercedes sold almost 40,000 battery-powered vehicles and 121,500 plug-in hybrids this year, which combine internal combustion with battery, The Associated Press said.

"The tipping point is getting closer and we'll be ready as markets switch to electric-only by the end of this decade," Bloomberg quoted chief executive officer Ola Kallenius as saying in a statement.

Some car manufacturers like Volvo Cars have committed to going all electric by 2030, while General Motors said it plans to build an all-electric lineup by 2035.

Other carmakers like Ford, Stellantis, Volkswagen and BMW have made similar promises about a changeover to mostly selling electric vehicles.

Low and zero-emission transportation is viewed as being a crucial tool for major economies trying to minimize their carbon footprint and reduce air pollution.

The British government, for instance, is looking at suspending the sale of new diesel and gasoline-powered cars by 2030 and require all new cars and vans to have zero emissions by 2035, CNBC said.

Mercedes has said its model lineup will be climate neutral by 2039, but had not given any specific date for discontinuing sales of internal combustion engines.

For now, sales of highly profitable diesel and gasoline sedans and sport utility vehicles are bringing in the cash to invest in the transition to electric vehicles.