Eight others were injured, including two seriously, and one person was unaccounted for.
The blaze started at 10:31 a.m. at a three-story factory building owned by Aricell, a local primary battery maker, in the industrial city in Gyeonggi Province.
The cause of the fire remains unknown, but witnesses said battery cells exploded on the second floor at the time of the fire.
The deceased included 18 Chinese, two South Koreans, one Laotian, and one person of unknown nationality.
Twenty-one victims were found dead on the second floor around 3 p.m. when firefighters nearly controlled the main fire and managed to enter the building, Kim Jin-young, an official of the Hwaseong Fire Station, said.
Earlier, just after the fire occurred, one worker was found in cardiac arrest and died later.
Two workers were severely wounded and transferred to nearby hospitals, while six others sustained minor injuries, the official said.
The fire was presumed to have been sparked by explosions of battery cells.
"At the time of the incident, there was an eyewitness account that batteries exploded during the inspection and packaging of batteries," Kim said.
More than 35,000 lithium batteries were stored on the second floor of the building at the time, he said.
The concrete building, spanning a total floor space of about 2,300 square meters, houses operations for manufacturing primary batteries using lithium.
Firefighters had difficulty controlling the blaze as fires involving chemicals such as lithium are difficult to put out with conventional fire extinguishers or hydrants.
President Yoon Suk Yeol and Prime Minister Han Duck-soo visited the site later in the day.
Yoon instructed officials to thoroughly investigate the cause of the fire and come up with measures to prevent a recurrence.
Copyright ⓒ Aju Press All rights reserved.