Throughout the world, men who have sex with men (MSM) are at increased risk for HIV infection compared to heterosexual men. Little is known about awareness of HIV infection and other gaps in the HIV care continuum for MSM, especially in sub-Saharan Africa (SSA). This information is urgently needed to address the HIV epidemic in this population. This study assessed gaps in the HIV care continuum among persons screened for participation in a multi-country prospective study that evaluated the feasibility of recruiting and retaining MSM for HIV prevention studies in SSA (HIV Prevention Trials Network (HPTN) 075, conducted in four cities in Kenya, Malawi, and South Africa). Participants were recruited using site-specific strategies, that included outreach and informal networks. Transgender women (TW) were eligible to participate. During screening, 601 MSM and TW were tested for HIV infection and asked about prior HIV testing, HIV status, engagement in care, and HIV treatment. Viral load testing and retrospective antiretroviral (ARV) drug testing were performed for HIV-infected participants. Most participants (92.2%) had a prior HIV test; 42.1% were last tested >6 months earlier. HIV prevalence was 30.4%. HIV infection was associated with older age and identifying as female or transgender; 43.7% of the HIV-infected participants were newly diagnosed, especially younger persons and persons with a less recent HIV test. Almost a third of previously-diagnosed participants were not linked to care. Most participants (88.7%) in care were on ARV treatment (ART). Only about one-quarter of all HIV-infected participants were virally suppressed. These findings demonstrate substantial prevalence of undiagnosed HIV infection and sub-optimal HIV care engagement among MSM and TW in SSA. Increased HIV testing frequency and better linkage to care represent critical steps in preventing further HIV transmission in this population. Once in care, gaps in the HIV care continuum appear less critical.