HIV-1 infection continues to affect global health. Although antiretrovirals can reduce the viral load or prevent HIV-1 infection, current drugs require daily oral use with a high adherence level. Long-acting antiretrovirals (LA-ARVs) significantly improve medication adherence and are essential for HIV-1 prophylaxis and therapy. This study aimed to investigate the safety and efficacy of long-acting cabotegravir (CAB-LA) and long-acting rilpivirine (RPV-LA) in the prevention and treatment of HIV-1 infection. PubMed, Embase, and the Cochrane Library were searched for studies from database inception to November 12, 2022. We included studies that reported efficacy and safety data on LA-ARV intervention in people living with HIV and excluded reviews, animal studies, and articles with missing or duplicate data. Virological suppression was defined as plasma viral load <50 copies/mL 6 months after antiviral therapy initiation. We extracted outcomes for analysis and expressed dichotomous data as risk ratios (RRs) and continuous data as mean differences. Depending on the heterogeneity assessment, a fixed- or random-effects model was used for data synthesis. We performed subgroup analyses of the partial safety and efficacy outcomes of CAB-LA+RPV-LA. The protocol was registered with the Open Science Framework. We included 12 trials comprising 10,957 individuals, of which 7 were prevention trials and 5 were treatment trials. CAB-LA and RPV-LA demonstrated safety profiles comparable with those of the placebo in terms of adverse event-related withdrawal. Moreover, the efficacy data showed that CAB-LA had a better effect on HIV-1 prevention than tenofovir disoproxil fumarate-emtricitabine (17/5161, 0.33% vs 75/5129, 1.46%; RR 0.21, 95% CI 0.07-0.61; I2=70%). Although CAB-LA+RPV-LA had more drug-related adverse events (556/681, 81.6% vs 37/598, 6.2%; RR 12.50, 95% CI 3.98-39.23; I2=85%), a mild or moderate injection site reaction was the most common reaction, and its frequency decreased over time. The efficacy of CAB-LA+RPV-LA was comparable with that of daily oral drugs at 48 and 96 weeks (1302/1424, 91.43% vs 915/993, 92.2%; RR 0.99, 95% CI 0.97-1.02; I2=0%), and a high level of virological suppression of 80.9% (186/230) was maintained even after 5 years of LA-ARV use. Similar efficacy outcomes were observed in both treatment-naive and treatment-experienced patients (849/911, 93.2% vs 615/654, 94%; RR 0.99, 95% CI 0.96-1.02; I2=0%). According to the questionnaires, more than 85% of people living with HIV favored LA-ARVs. LA-ARVs showed favorable safety profiles for both the prevention and treatment of HIV-1 infection and were well tolerated. CAB-LA has more satisfactory efficacy than tenofovir disoproxil fumarate-emtricitabine, significantly reducing the rate of HIV-1 infection. CAB-LA+RPV-LA maintains virological suppression for a long time and may be a viable switching strategy with enhanced public health benefits by reducing transmission. However, further trials are required to confirm the efficacy of these drugs.