SAMHD1 restricts the infection of dendritic and other myeloid cells by human immunodeficiency virus type 1 (HIV-1), but in lentiviruses of the simian immunodeficiency virus of sooty mangabey (SIVsm)-HIV-2 lineage, SAMHD1 is counteracted by the virion-packaged accessory protein Vpx. Here we found that SAMHD1 restricted infection by hydrolyzing intracellular deoxynucleoside triphosphates (dNTPs), lowering their concentrations to below those required for the synthesis of the viral DNA by reverse transcriptase (RT). SAMHD1-mediated restriction was alleviated by the addition of exogenous deoxynucleosides. An HIV-1 with a mutant RT with low affinity for dNTPs was particularly sensitive to SAMHD1-mediated restriction. Vpx prevented the SAMHD1-mediated decrease in dNTP concentration and induced the degradation of human and rhesus macaque SAMHD1 but had no effect on mouse SAMHD1. Nucleotide-pool depletion could be a general mechanism for protecting cells from infectious agents that replicate through a DNA intermediate.