||BACKGROUND: Monitoring cancer risk among HIV-infected people in the modern antiretroviral therapy (ART) era is essential given their elevated risk for many cancers and prolonged survival with immunosuppression, ART exposure, and ageing. We aimed to examine cancer risk in HIV-infected people in the USA as compared with that in the general population. METHODS: We did a registry-linkage study with data from population-based HIV and cancer registries in the USA (the HIV/AIDS Cancer Match Study). We assessed a cohort of HIV-infected people identified in HIV registries in Colorado, Connecticut, Georgia, Maryland, Michigan, New Jersey, New York, Puerto Rico, and Texas from 1996 to 2012. Follow-up started 3 months after either the latest of the beginning of systematic name-based state HIV registration, HIV report date (or AIDS diagnosis, if this was earlier), start of cancer registration, or Jan 1, 1996, and ended at the earliest of either death, end of cancer-registry coverage, or Dec 31, 2012. We identified diagnoses of cancer in this population through linkage with corresponding cancer registries and calculated standardised incidence ratios (SIRs) to measure cancer risk in people with HIV compared with the USA general population, by dividing the observed number of cases in people with HIV by the expected number (estimated by applying general population cancer-incidence rates to person-time in the HIV population based on sex, age, race or ethnic group, calendar year, and registry). We tested SIR differences by AIDS status and over time using Poisson regression. FINDINGS: Among 448 258 people with HIV (who contributed 3 093 033 person-years), 21 294 incident cancers were diagnosed during 1996-2012. In these people, compared with the general population, risk was elevated (p<0·0001 for all) for cancer overall (SIR 1·69, 95% CI 1·67-1·72), AIDS-defining cancers (Kaposi's sarcoma [498·11, 477·82-519·03], non-Hodgkin lymphoma [11·51, 11·14-11·89], and cervix [3·24, 2·94-3·56]), most other virus-related cancers (eg, anus [19·06, 18·13-20·03], liver [3·21, 3·02-3·41], and Hodgkin's lymphoma [7·70, 7·20-8·23]), and some virus-unrelated cancers (eg, lung [1·97, 1·89-2·05]), but not for other common cancers. Risk for several cancers was higher after AIDS onset and declined across calendar periods. After multivariable adjustment, SIRs decreased significantly across 1996-2012 for Kaposi's sarcoma, two subtypes of non-Hodgkin lymphoma, and cancer of the anus, liver, and lung, but remained elevated. SIRs did not increase over time for any cancer. INTERPRETATION: For several virus-related cancers and lung cancer, declining risks over time in HIV-infected people probably reflect the expansion of ART since 1996. Additional efforts aimed at cancer prevention and screening in people with HIV are warranted. FUNDING: National Cancer Institute.