The aryl hydrocarbon receptor (AhR) is a ligand-dependent transcription factor whose activation induces the expression of numerous genes, with many effects on cells. However, AhR activation is not known to affect the replication of viruses. We show that AhR activation in macrophages causes a block to HIV-1 and HSV-1 replication. We find that AhR activation transcriptionally represses cyclin-dependent kinase (CDK)1/2 and their associated cyclins, thereby reducing SAMHD1 phosphorylation, cellular dNTP levels and both HIV-1 and HSV-1 replication. Remarkably, a different antiviral stimulus, interferon gamma (IFN-Îł), that induces a largely non-overlapping set of genes, also transcriptionally represses CDK1, CDK2 and their associated cyclins, resulting in similar dNTP depletion and antiviral effects. Concordantly, the SIV Vpx protein provides complete and partial resistance to the antiviral effects of AhR and IFN-Îł, respectively. Thus, distinct antiviral signaling pathways converge on CDK/cyclin repression, causing inhibition of viral DNA synthesis and replication.