BMW has signed a huge contract with Chinese battery maker Contemporary Amperex Technology (CATL) to purchase almost $5 billion worth of batteries from the company.

During an announcement regarding CATL’s upcoming production site in Germany, BMW purchasing head Markus Duesmann said the automaker will source 4 billion euros ($4.7 billion) worth of batteries from CATL in the coming years to power its upcoming fleet of electric vehicles.

The contract comes despite the fact that BMW is actively investing in its own battery cell research, and shows the company’s willingness to outsource a pivotal component that’ll drive many of its vehicles in the future. The contract also serves as a testament to China’s expertise in building world-class battery cells at a good price.

CATL’s German facility will be located in the Thuringa region and the first phase of the project will call for around 240 million euros ($280 million) of investments. Roughly 1.5 billion euros worth of batteries ordered by BMW will be produced at the site.

Speaking to Reuters, CATL chairman Robin Zeng said the firm is open to the idea of building more factories.

“We want to supply all the OEMs (manufacturers) in Europe. If the Thuringia project is successful, then we can consider other locations,” Zeng said.

BMW currently receives its batteries from two different suppliers, but said that it is considering working with a third and is in discussions with eight manufacturers.

The German carmaker confirmed that it had invested in CATL’s Germany factory, though both companies declined to disclose the extent of the financial contribution.