Tesla Motors had an obligation to pay a total of about $1.7 billion to Japan’s Panasonic as of Sept. 30 for electric vehicle battery cells made at Tesla’s gigafactory in Nevada, the carmaker said in a regulatory filing.

Panasonic pcrfy , Tesla’s longstanding battery partner, agreed in 2014 to invest in equipment, machinery and other manufacturing tools at the gigafactory, which will make cylindrical lithium-ion cells for Tesla’s cars.

Tesla tsla has said it expects to start making batteries at the $5 billion plant by the end of the year.

The batteries will be used initially in Tesla’s energy products and later in its cars.

Tesla also said on Wednesday it had incurred about $608 million of costs for its gigafactory as of Sept. 30.

The company said in August it expected to spend about $520 million on the construction of the plant in all of 2016.