To combat hostile viruses, bacteria and archaea have evolved a unique antiviral defense system composed of clustered regularly interspaced short palindromic repeats (CRISPRs), together with CRISPR-associated genes (Cas). The CRISPR/Cas9 system develops an adaptive immune resistance to foreign plasmids and viruses by creating site-specific DNA double-stranded breaks (DSBs). Here we adapt the CRISPR/Cas9 system to human cells for intracellular defense against foreign DNA and viruses. Using HIV-1 infection as a model, our results demonstrate that the CRISPR/Cas9 system disrupts latently integrated viral genome and provides long-term adaptive defense against new viral infection, expression and replication in human cells. We show that engineered human-induced pluripotent stem cells stably expressing HIV-targeted CRISPR/Cas9 can be efficiently differentiated into HIV reservoir cell types and maintain their resistance to HIV-1 challenge. These results unveil the potential of the CRISPR/Cas9 system as a new therapeutic strategy against viral infections.