A fire at a lithium battery factory near Seoul​ on Monday killed 22 workers, most of them migrant laborers from China, in one of the deadliest blazes in South Korea in years, officials said.

Officials said that rescuers were still searching the building in Hwaseong, 28 miles south of Seoul, for one worker who had been reported missing. They said it was unclear whether the worker was in the building when the fire broke out.

​Two workers were hospitalized with serious injuries. Six others suffered minor injuries.

Kim Jin-young, an official with the Hwaseong Fire Department, said 102 people had been working in the factory, owned by the battery maker Aricell, when the fire broke out. The 22 victims included 18 migrants​ from China and one from Laos, as well as two South Koreans.

They were found dead on the 12,500-square foot second floor of the factory. The floor had two unlocked exit staircases leading outside, but the workers appeared to have been overcome by the flames and toxic smoke before reaching them, Mr. Kim said.

Workers who fled the fire said it started when a single battery cell caught fire, triggering a series of explosions among some of the 35,000 lithium battery cells stored on the factory’s second floor, according to Mr. Kim.

Fires can occur in lithium batteries when the inside layers are compressed, causing a short circuit. The layers can become compressed by a sudden impact, such as during a vehicle collision, or by gradual swelling of the batteries through regular use.