ROCKCASTLE COUNTY, Ky. (WDKY) — A train derailed and spilled a chemical in a remote part of eastern Kentucky on Wednesday, prompting officials to encourage residents to evacuate amid concerns about air quality.

Rail operator CSX announced on Thursday that a chemical fire at the derailment site has been completely extinguished. The CSX train derailed around 2:30 p.m. Wednesday near Livingston, a remote town with about 200 people in Rockcastle County.

One crew member on the train was treated at the scene for minor injuries, according to officials.

Two of the 16 cars that derailed carried molten sulfur, which caught fire after the cars were breached, CSX said in a statement.

It’s believed that the fire released the potentially harmful gas sulfur dioxide, but officials have not released results of measurements taken from air monitoring equipment.

According to the Environmental Protection Agency website, sulfur dioxide can cause respiratory problems, depending on the concentration and length of exposure. The gas is commonly produced by burning fossil fuels at power plants and other industrial processes, the EPA says.

The derailment meant some Livingston residents woke up on Thanksgiving in a middle school shelter. Tina Doan, an evacuee, said her family had just sat down for dinner Wednesday night when they found out they had to leave their home.

Doan said she was initially aggravated but thankful the shelter took them in.

“At least they cared enough to come and get us. We’ve got a lot to be thankful for,” Doan told Nexstar’s WDKY. “We think about a dinner, but I think our lives mean so much more. So this Thanksgiving, I’m not going to forget this. I’m really not.”

CSX promised to pay the costs of anyone asked to evacuate, including a Thanksgiving dinner.

Following the derailment, Kentucky Gov. Andy Beshear declared a state of emergency.

“By issuing a state of emergency, we are ensuring that every state resource is available to help keep our families safe,” Beshear said. “Please stay clear of this area as state, local and CSX officials respond.”

Sen. Brandon Storm (R-London), who represents the 21st Senate District, including Rockcastle County, also released a statement praising the response to the community.

“I want to commend the collective response and how everyone has stepped up to protect and inform residents in these communities,” he said. “The response was swift, and Rockcastle County Middle School was quickly made into an overnight shelter, a safe location for those impacted.”

The Associated Press contributed to this report.