Marine environments are frequently oligotrophic, characterized by low amount of bioassimilable Nitrogen sources. At the global scale, the microbial fixation of N2, or diazotrophy, represents the primary source of fixed nitrogen in pelagic marine ecosystems, playing a key role in supporting primary production and driving the export of organic matter to the deep ocean. However, given the high energetic cost of N2 fixation, the active release of fixed nitrogen by diazotrophs appears counterintuitive, suggesting the existence of alternative, passive release pathways, that remain understudied to date. Here, we show that the marine Non Cyanobacterial Diazotroph Vibrio diazotrophicus is endowed with a prophage belonging to the Myoviridae family, whose expression is induced under anoxic and biofilm-forming conditions. We demonstrate that this prophage can spontaneously excise from the genome of its host and that it forms intact and infective phage particles. Moreover, phage-mediated host cell lysis leads to increased biofilm production as compared to a prophage-free derivative mutant, and to increased release of Dissolved Organic Carbon and of ammonium. Altogether, we provide evidences that viruses may play a previously unrecognized role in oceanic ecosystem dynamics by structuring micro-habitats suitable for diazotrophy and by contributing to the recycling of (in-)organic matter.