Background: The Covid-19 pandemic had great impact on HIV care and prevention worldwide, including in Brazil. We compared HIV testing, recent infection, and annualized incidence according to Covid-19 pandemic period among men who have sex with men (MSM) and transgender women (TGW). Setting: HIV/STI testing, prevention and treatment referral service in Rio de Janeiro, Brazil Methods: We used Maxim HIV-1 Limiting Antigen Avidity EIA as part of recent infection testing algorithm to identify recent HIV infections and estimate annualized HIV incidences in pre- (March/2018-February/2020) and post-Covid-19 pandemic onset period (March/2020-January 2022). Multivariable logistic regression model assessed factors associated with recent HIV infection. Results: Among 4590 MSM and TGW, 593 (12.9%) tested positive for HIV and 119 (2.6%) were identified as having recent infection. Percentage of recent HIV infection did not differ between Covid-19 periods. Overall annualized HIV incidence rates were 6.0% (95%CI:4.2-7.7) and 6.6% (95%CI:4.3-9.0) in pre- and post-Covid-19 periods, respectively. During the post-Covid-19 period, higher incidence rates were observed among TGW (8.4%[95%CI:2.9-13.9]), those aged 18-24 years (7.8%[ 95%CI:4.0-11.7]), Black race (7.9%[95%CI:3.8-12.0]), and with <12 years of schooling (7.8%[95%CI:4.8-10.8]). Incidence rates were significantly higher in the post-Covid-19 period for those aged>30 years and TGW, and lower for those with more years of schooling. Conclusion: HIV incidence estimates remain high among MSM and TGW in Brazil, especially among the most vulnerable. The consequences of the Covid-19 pandemic on the HIV epidemic will likely persist and contribute to worsening HIV outcomes.