Cell cycle-dependent expression of canonical histone proteins enables newly synthesized DNA to be integrated into chromatin in replicating cells. However, the molecular basis of cell cycle-dependency in the switching of histone gene regulation remains to be uncovered. Here, we report the identification and biochemical characterization of a molecular switcher, HERS (histone gene-specific epigenetic repressor in late S phase), for nucleosomal core histone gene inactivation in Drosophila. HERS protein is phosphorylated by a cyclin-dependent kinase (Cdk) at the end of S-phase. Phosphorylated HERS binds to histone gene regulatory regions and anchors HP1 and Su(var)3-9 to induce chromatin inactivation through histone H3 lysine 9 methylation. These findings illustrate a salient molecular switch linking epigenetic gene silencing to cell cycle-dependent histone production.