Deoxyribonucleoside regulator (DeoR) from Bacillus subtilis downregulates the expression of enzymes involved in deoxyribonucleosides and deoxyribose catabolism. The DeoR repressor comprises a C-terminal effector-binding domain (C-DeoR) and an N-terminal DNA-binding domain. We present here the crystal structures of the free C-DeoR and of the covalent complex of C-DeoR with the effector molecule deoxyribose-5-phosphate (dR5P). This is the first case of a bacterial transcriptional regulator that binds its effector covalently via a Schiff base linkage to a lysine residue (Lys141). Mutational analysis confirmed the key role of Lys141 in effector binding and the formation of the Schiff base adducts in solution was confirmed by mass spectrometry. Structural analyses of the crystal structures of the free and effector-bound C-DeoR explained the function of DeoR as a molecular switch.