Although it is well recognized that bacteria respond to environmental stress through global networks, the mechanism by which stress is relayed to the interior of the cell is poorly understood. Here we show that enigmatic toxin-antitoxin systems are vital in mediating the environmental stress response. Specifically, the antitoxin MqsA represses rpoS, which encodes the master regulator of stress. Repression of rpoS by MqsA reduces the concentration of the internal messenger 3,5-cyclic diguanylic acid, leading to increased motility and decreased biofilm formation. Furthermore, the repression of rpoS by MqsA decreases oxidative stress resistance via catalase activity. Upon oxidative stress, MqsA is rapidly degraded by Lon protease, resulting in induction of rpoS. Hence, we show that external stress alters gene regulation controlled by toxin-antitoxin systems, such that the degradation of antitoxins during stress leads to a switch from the planktonic state (high motility) to the biofilm state (low motility).