Emerging studies demonstrate that the antiviral activity of viral fusion inhibitor peptides can be dramatically improved when being chemically or genetically anchored to the cell membrane, where viral entry occurs. We previously reported that the short-peptide fusion inhibitor 2P23 and its lipid derivative possess highly potent antiviral activities against human immunodeficiency virus type 1 (HIV-1), HIV-2, and simian immunodeficiency virus (SIV). To develop a sterilizing or functional-cure strategy, here we genetically linked 2P23 and two control peptides (HIV-1 fusion inhibitor C34 and hepatitis B virus [HBV] entry inhibitor 4B10) with a glycosylphosphatidylinositol (GPI) attachment signal. As expected, GPI-anchored inhibitors were efficiently expressed on the plasma membrane of transduced TZM-bl cells and primarily directed to the lipid raft site without interfering with the expression of CD4, CCR5, and CXCR4. GPI-anchored 2P23 (GPI-2P23) completely protected TZM-bl cells from infections of divergent HIV-1, HIV-2, and SIV isolates as well as a panel of enfuvirtide (T20)-resistant mutants. GPI-2P23 also rendered the cells resistant to viral envelope-mediated cell-cell fusion and cell-associated virion-mediated cell-cell transmission. Moreover, GPI-2P23-modified human CD4(+) T cells (CEMss-CCR5) fully blocked both R5- and X4-tropic HIV-1 isolates and displayed a robust survival advantage over unmodified cells during HIV-1 infection. In contrast, it was found that GPI-anchored C34 was much less effective in inhibiting HIV-2, SIV, and T20-resistant HIV-1 mutants. Therefore, our studies have demonstrated that genetically anchoring a short-peptide fusion inhibitor to the target cell membrane is a viable strategy for gene therapy of both HIV-1 and HIV-2 infections. IMPORTANCE Antiretroviral therapy with multiple drugs in combination can efficiently suppress HIV replication and dramatically reduce the morbidity and mortality associated with AIDS-related illness; however, antiretroviral therapy cannot eradiate the HIV reservoirs, and lifelong treatment is required, which often results in cumulative toxicities, drug resistance, and a multitude of complications, thus necessitating the development of sterilizing-cure or functional-cure strategies. Here, we report that genetically anchoring the short-peptide fusion inhibitor 2P23 to the cell membrane can fully prevent infections from divergent HIV-1, HIV-2, and SIV isolates as well as a panel of enfuvirtide-resistant mutants. Membrane-bound 2P23 also effectively blocks HIV-1 Env-mediated cell-cell fusion and cell-associated virion-mediated cell-cell transmission, renders CD4(+) T cells nonpermissive to infection, and confers a robust survival advantage over unmodified cells. Thus, our studies verify a powerful strategy to generate resistant cells for gene therapy of both the HIV-1 and HIV-2 infections.