Transitions in eruptive style are common at volcanoes. Understanding how and why these transitions occur remain open questions. The 2012 eruption of the submarine Havre volcano in the Kermadec arc (southwest Pacific Ocean) produced a raft of floating pumice followed by a pair of domes from the same vent. Here, we used measurements on erupted magmas and constraints on the eruption rate, combined with a model for magma ascent, to identify the dominant controls on the transition in eruption style. During the raft-forming stage, magma ascent was fast enough that little gas was lost. Magma reached the seafloor with great enough vesicularity to be buoyant and produce clasts that could float. As the eruption waned, the eruption rate decreased, and the conduit narrowed. Sufficient gas was then lost to the surrounding country rocks during ascent such that the erupted magma was no longer buoyant relative to seawater. Most of the original dissolved water in the magma was lost to the crust surrounding the conduit during the dome-forming stage.