The HIV-1 restriction factor SAM domain– and HD domain–containing protein 1 (SAMHD1)1,2 is proposed to inhibit HIV-1 replication by depleting the intracellular dNTP pool3–5. However, phosphorylation of SAMHD1 regulates its ability to restrict HIV-1 without decreasing cellular dNTP levels6–8, which is not consistent with a role for SAMHD1 dNTPase activity in HIV-1 restriction. Here, we show that SAMHD1 possesses RNase activity and that the RNase but not the dNTPase function is essential for HIV-1 restriction. By enzymatically characterizing Aicardi-Goutières syndrome (AGS)-associated SAMHD1 mutations and mutations in the allosteric dGTP-binding site of SAMHD1 for defects in RNase or dNTPase activity, we identify SAMHD1 point mutants that cause loss of one or both functions. The RNase-positive and dNTPase-negative SAMHD1D137N mutant is able to restrict HIV-1 infection, whereas the RNase-negative and dNTPase-positive SAMHD1Q548A mutant is defective for HIV-1 restriction. SAMHD1 associates with HIV-1 RNA and degrades it during the early phases of cell infection. SAMHD1 silencing in macrophages and CD4+ T cells from healthy donors increases HIV-1 RNA stability, rendering the cells permissive for HIV-1 infection. Furthermore, phosphorylation of SAMHD1 at T592 negatively regulates its RNase activity in cells and impedes HIV-1 restriction. Our results reveal that the RNase activity of SAMHD1 is responsible for preventing HIV-1 infection by directly degrading the HIV-1 RNA.