Summary Background: In response to the rising prevalence of non-nucleoside reverse transcriptase inhibitors (NNRTIs) resistance, millions of people living with HIV (PWH) have switched to dolutegravir-based antiretroviral therapy (ART). Understanding the possible emergence of dolutegravir resistance is essential for health policy and planning. We developed a mathematical model to predict the trends of dolutegravir resistance in PWH in South Africa. Methods: MARISA (Modelling Antiretroviral drug Resistance In South Africa) is a deterministic compartmental model consisting of four layers: (i) the cascade of care, (ii) disease progression, (iii) gender, and (iv) drug resistance. MARISA was calibrated to reproduce the HIV epidemic in South Africa. We assumed dolutegravir was introduced in 2020. We extended the model by including key resistance mutations observed in PWH experiencing virologic failure on dolutegravir-based ART (G118K, E138AKT, G140ACS, Q148HKNR, N155H, and R263K). Model outcomes were acquired (ADR) and transmitted drug resistance (TDR) to dolutegravir and NNRTIs stratified by duration on failing dolutegravir-based ART and under different counterfactual scenarios of switching to protease-inhibitor (PI)-based ART. Finding: The model predicts that ADR will increase rapidly, from 18.5% (uncertainty range 12.5% to 25.4%) in 2023 to 46.2% (32.9% to 58.9%) in 2040. The prevalence of ADR in 2040 increased with the duration of virologic failure on dolutegravir-based ART: 18.0% (12.2% to 23.7%) for 6 months of failing ART compared to 54.8% (41.1% to 63.9%) for over 1.5 years. For TDR, the model predicts a slow but steady increase from 0.1% (0.1% to 0.2%) in 2023 to 8.8% (4.4% to 17.3%) in 2040. Transmitted NNRTI resistance will cease to increase but remain prevalent at 7.7% in 2040. Rapid resistance testing-informed switching to PI-based ART would substantially reduce both ADR and TDR. Interpretation: The prevalence of dolutegravir ADR and TDR will likely increase, with the 10% threshold of TDR possibly reached by 2035, depending on monitoring and switching strategies. The increase will likely be greater in settings where resources for HIV-1 RNA monitoring and resistance testing or options for switching to alternative ART regimens are limited. Funding: Swiss National Science Foundation, National Institutes of Health, UZH URPP Evolution in Action