Aims. The released magnetic energy in coronal events, i.e. in flares and coronal mass ejections (CMEs), is believed to have been stored locally in the coronal magnetic field. The energy in a magnetic field B is distributed in space with densitythat is also the isotropic magnetic pressure at each point in space. A localized release of magnetic energy would therefore imply a localized reduction of magnetic pressure. Hence, such a release could lead to an implosion of the magnetic structure as its atmospheric surrounding pushes inward. Whether an implosion would take place immediately depends on how fast the released energy can escape, through optically-thin radiation, thermal conduction, hydromagnetic waves, and, the magnetic channeling of high-energy particles. Methods. We determined whether an expansion or an implosion would occur when cylindrical tubes of twisted flux relaxed to lower energy states. Depending on the dynamical nature of the relaxation we assumed, relevant dynamical invariants were invoked to relate a particular end state to the given initial state. Results. Comparing the initial and the end state, we found that when most of the liberated energy escaped the cylinder imploded. The results suggest that implosions may take place simultaneously with flares and CMEs.