Early initiation of antiretroviral therapy (ART) reduces the risk of drug-sensitive HIV transmission but may increase the transmission of drug-resistant HIV. We used a mathematical model to estimate the long-term population-level benefits of ART and determine the scenarios under which earlier ART (treatment at 1 year post-infection, on average) could decrease simultaneously both total and drug-resistant HIV incidence (new infections). We constructed an infection-age-structured mathematical model that tracked the transmission rates over the course of infection and modelled the patients' life expectancy as a function of ART initiation timing. We fitted this model to the annual AIDS incidence and death data directly, and to resistance data and demographic data indirectly among men who have sex with men (MSM) in San Francisco. Using counterfactual scenarios, we assessed the impact on total and drug-resistant HIV incidence of ART initiation timing, frequency of acquired drug resistance, and second-line drug effectiveness (defined as the combination of resistance monitoring, biomedical drug efficacy and adherence). Earlier ART initiation could decrease the number of both total and drug-resistant HIV incidence when second-line drug effectiveness is sufficiently high (greater than 80%), but increase the proportion of new infections that are drug resistant. Thus, resistance may paradoxically appear to be increasing while actually decreasing.