Background Early antiretroviral therapy (ART) initiation (ie, within 3 months of infection) limits establishment of the HIV reservoir. However, the effect of early ART initiation on the long-term dynamics of the pool of infected cells remains unclear.Methods In this longitudinal analysis, we included cisgender men who have sex with men (MSM) and transgender women (aged 18-54 years) at high risk for HIV infection, enrolled in the ongoing longitudinal MERLIN study in Peru between Oct 28, 2014, and Nov 8, 2018. Participants were eligible if they had been infected with HIV less than 90 days before enrolment, and if they had cryopreserved peripheral blood mononuclear cell (PBMC) samples. Participants were stratified into three groups on the basis of whether they initiated ART at 30 days or less (acute group), at 31-90 days (early group), or more than 24 weeks (deferred group) after the estimated date of detectable infection. PBMC samples were collected before ART initiation and longitudinally for up to 4 years on ART. The main outcomes were to establish the size of the HIV reservoir before ART initiation and to assess the effect of the timing of ART initiation on the decay of the HIV reservoir over 4 years follow-up. We quantified viral load, and isolated CD4 cells to quantify total HIV DNA, integrated HIV DNA and 2-long terminal repeat circles. Longitudinal analysis of active and inducible HIV reservoirs were measured by quantifying the frequency of CD4 cells producing multiply-spliced HIV RNA ex vivo and after in-vitro stimulation with a tat/rev induced limiting dilution assay (TILDA). A mixed-effects model from the time of ART initiation was used to measure longitudinal decays in viral loads and each HIV reservoir measure in each of the three groups.Findings We included 56 participants in this analysis, all of whom were MSM: 15 were in the acute group, 19 were in the early group, and 22 were in the deferred group. Participants in all three groups had similar levels of all HIV reservoir markers before ART initiation. All participants, including those in the acute group, had a pool of transcriptionally silent HIV-infected cells before ART initiation, as indicated by a substantial increase in TILDA measures upon stimulation. Longitudinal analysis over 4 years of ART revealed a biphasic decay of all HIV persistence markers, with a rapid initial decline followed by a slower decay in all participants. During the first-phase decay, the half-lives of both total and integrated HIV DNA and TILDA measures were significantly shorter in the acute group than in the early and deferred groups. During the second-phase decay, HIV reservoir markers continued to decline only in participants in the acute group.Interpretation Participants who initiated ART within 30 days or less of HIV infection showed a steeper and more sustained decay in HIV reservoir measures, suggesting long-term benefit of acute ART initiation on reservoir clearance.