When a jail or any building contiguous or near thereto is on fire, and there is reason to apprehend that the prisoners therein may be injured thereby, the sheriff or keeper must remove such prisoners to some safe and convenient place, and there confine them so long as it may be necessary to avoid such danger.
Iowa Code § 356.8