Employees stand in front of the SK Hynix Inc. logo displayed at the company's office in Seongnam, South Korea, on Monday, July 24, 2017.

South Korea's SK Hynix on Thursday said it would spend $107 billion building four factories, as the memory chip maker seeks to maintain its competitiveness in the face of Chinese efforts to become a leading chipmaking nation.

The chip fabrication plants will be built on a 4.5 million square meter site south of Seoul beginning 2022, complementing two existing domestic factories that will receive a separate 55 trillion won ($49 billion) investment over the next decade.

The plans for the factories, producing DRAM and next-generation chips, come as chipmakers prepare for a surge in demand to power new technology such as fifth-generation (5G) communication networks and artificial intelligence, even as a slowdown in smartphone sales kills off a two-year chip boom.

"Though there is not enough chip demand for autonomous cars now, I believe there will be much more demand for self-driving vehicles in the next 10 years or as early as in 2023 or 2024," said analyst Kim Young-gun at Mirae Asset Daewoo.

"That will create more chip demand for SK Hynix," as will the commercialization of 5G networks over the next few years, Kim said.

The plan also intensifies an arms race between South Korea, the world's biggest exporter of memory chips, and China, which has been aggressively encouraging chipmaking investment to curb reliance on imports amid a trade spat with the United States.

China is the world's largest chip consumer, importing $270 billion worth in 2017 - more than its total imports of crude oil.