A good Samaritan offered to buy hotel rooms for 70 vagrants camped out overnight in Chicago amid frigid temperatures.

The dozens of people had set up tents Wednesday as the mercury dipped to minus 23 degrees with a wind chill of 49 below zero, the Chicago Tribune reported.

The group used 100 donated propane tanks to keep warm, but one of them exploded Wednesday afternoon.

So the Chicago Fire Department urged the group not to use the tanks and called the Salvation Army for help.

As the charity worked to move the encampment to one of their warming centers, the city called to say a generous soul had offered to put them up in a hotel on the South Side.

“Isn’t that wonderful? At least they’re warm and they’re safe,’’ said Salvation Army spokeswoman Jacqueline Rachev.

“All the folks there, some wonderful citizen is going to put all of them up at a hotel for the rest of the week,” she said.

Only one of the homeless people opted not to go to the hotel and went to the warming center instead.