Deep long-period (DLP) earthquakes observed beneath active volcanoes are sometimes considered as precursors to eruptions. Their origin remains, however, unclear. Here, we present a possible DLP generating mechanism related to the rapid growth of gas bubbles in response to the slow decompression of over-saturated magma. For certain values of the gas and bubble content, the elastic deformation of surrounding rocks forced by the expanding bubbly magma can be fast enough to generate seismic waves. We show that amplitudes and frequencies of DLP earthquakes observed beneath the Klyuchevskoy volcano (Kamchatka, Russia) can be predicted by our model when considering pressure changes of ~107?Pa in a volume of ~103-104 m3 and realistic magma compositions. Our results show importance of the deep degassing in the generation of volcanic seismicity and suggest that the DLP swarms beneath active volcanoes might be related to the pulses of volatile-rich basaltic magmas rising from the mantle.