Modification of the magnetic properties in as olidstate materialu pon external stimulus has attracted much attention in the recent years for their potential applications as switches and sensors. Within the field of coordination polymers, gas sorption studies typically focus on porous solids, with the gas molecules accommodating in the channels.Here we present a1 Dn on-porous coordination polymerc apable of incorporatingH Cl gas molecules, whichn ot only causes ar eordering of its atoms in the solid state but also provokes dramatic changes in the magnetic behavior.Subsequently, af urther solid-gas transformation can occur with the extrusion of HCl gas molecules causing as econd structural rearrangement, which is also accompanied by modification in the magnetic path between the metal centers. Unequivocale videnceo ft he two-step magnetostructural transformation is providedb yX-ray single-crystal diffraction.