Tesla Inc. agreed to pay China 2.23 billion yuan ($323 million) in tax every year as part of a deal with local authorities to build an electric-vehicle factory on the outskirts of Shanghai.

Under the terms of the lease with the Shanghai government, Tesla must start generating the annual tax revenues at the end of 2023 -- or hand the land back, the company’s latest quarterly filing shows.

The U.S. company must also spend 14.08 billion yuan ($2 billion) in capital expenditure on the plant over the next five years, according to the lease. Tesla’s first overseas plant is aimed at avoiding tariffs and keeping prices down in the world’s largest electric-vehicle market.

The obligations aren’t onerous compared with the company’s own targets, which include sinking several billion dollars into the facility. Tesla said last week it aims to produce half a million cars at the Shanghai site over the next 12 months, depending on how quickly output ramps up.

“We believe the capital expenditure requirement and the tax revenue target will be attainable even if our actual vehicle production was far lower than the volumes we are forecasting,” Tesla said in the filing.