Chicago railway employees are setting train tracks on fire to ensure commuter trains can continue running as extreme cold freezes most of the Midwest this week.

According to Chicago’s Metra rail authority, the measure presents the metal tracks from contracting and separating from one another.

Jalopnik explains:

When it gets to be several degrees below freezing, the metal of the train tracks can contract to the point that it will pull up the bolts holding it in place, or even stress fracture. Crews will soak long pieces of rope in kerosene and burn it to warm up the tracks, expanding them back into place for repairs. Once the track is warmed, it’ll be re-bolted, or welding repairs can be affected on the broken tracks.

CHICAGO: Crews set fires to keep train tracks from contracting as the city faces record low temperatures pic.twitter.com/CY2BmiGPcU — TicToc by Bloomberg (@tictoc) January 29, 2019

Crews are having to set train tracks on fire in Chicago to prevent them from freezing over so that the trains can keep moving! pic.twitter.com/cAgqG3bU0e — TODAY (@TODAYshow) January 30, 2019

It's so cold in Chicago that workers are setting fire to railroad tracks just to keep the trains moving. The extreme cold — around -22 F (-30 C) Wednesday morning — can cause rail defects. https://t.co/MEbpI5a3wi pic.twitter.com/6OSHwzxE3h — CNN International (@cnni) January 30, 2019

WATCH: In the midst of record low temperatures, Chicago crews are setting the train tracks on fire in order to prevent them from freezing over. pic.twitter.com/3P0PwJWj8y — NBC Nightly News with Lester Holt (@NBCNightlyNews) January 30, 2019

Historic cold envelops Chicago area causing school closures, flight and train service cancellations https://t.co/5jqLV3Urtd pic.twitter.com/iVxtwzLBMT — WGN TV News (@WGNNews) January 30, 2019

Meanwhile, extreme weather conditions have prompted Amtrak to cancel all trains into and out of Chicago.

Amtrak says short-distance and long-distance, overnight trains are canceled for Wednesday. Short-distance services are also canceled on Thursday, and most long-distance services to or from Chicago are also not expected to operate Thursday.

An Amtrak spokesman says customers with reservations on the affected trains will be accommodated on trains with similar departure times on another day.

The National Weather Service is forecasting wind chills could dip to 46 below zero in Chicago over the next two days.

Chicago temperatures are still dropping after plunging early Wednesday to minus 19 degrees, breaking the day’s previous record low set in 1966. Snowplows were idled overnight in southwestern Minnesota, where temperatures dropped to negative 29 degrees. The temperature in Fargo, North Dakota, was 31 degrees below zero.

Officials throughout the region were focused on protecting vulnerable people from the cold , including the homeless, seniors and those living in substandard housing. Some buses were turned into mobile warming shelters to help the homeless in Chicago.

Governors in Illinois, Wisconsin and Michigan declared emergencies as the worst of the cold threatened on Wednesday. In Chicago, major attractions closed because of the bitter cold, including the Lincoln Park Zoo, the Art Institute and the Field Museum.

The Associated Press contributed to this report.