Stability and resilience against environmental perturbations are critical properties of medical and environmental biofilms and pose important targets for their control. Biofilm stability is determined by two mutually exclusive processes: attachment of cells to and detachment from the biofilm matrix. Using Shewanella oneidensis MR-1, an environmentally versatile, Fe(III) and Mn(IV) mineral-reducing microorganism, we identified mxdABCD as a new set of genes essential for formation of a three-dimensional biofilm. Molecular analysis revealed that mxdA encodes a cyclic bis(3,5)guanylic acid (cyclic di-GMP)-forming enzyme with an unusual GGDEF motif, i.e., NVDEF, which is essential for its function. mxdB encodes a putative membrane-associated glycosyl transferase. Both genes are essential for matrix attachment. The attachment-deficient phenotype of a ⌬mxdA mutant was rescued by ectopic expression of VCA0956, encoding another diguanylate cyclase. Interestingly, a rapid cellular detachment from the biofilm occurred upon induction of yhjH, a gene encoding an enzyme that has been shown to have phosphodiesterase activity. In this way, it was possible to bypass the previously identified sudden depletion of molecular oxygen as an environmental trigger to induce biofilm dissolution. We propose a model for c-di-GMP as a key intracellular regulator for controlling biofilm stability by shifting the state of a biofilm cell between attachment and detachment in a concentration-dependent manner.