ABSTRACT: BACKGROUND:People transitioning from prisons or jails have high mortality, but data are scarce for people with HIV and no studies have integrated data from both criminal justice and community settings. We aimed to assess all-cause mortality in people with HIV released from an integrated system of prisons and jails in Connecticut, USA. METHODS:We linked pharmacy, custodial, death, case management, and HIV surveillance data from Connecticut Departments of Correction and Public Health to create a retrospective cohort of all adults with HIV released from jails and prisons in Connecticut between 2007 and 2014. We compared the mortality rate of adults with HIV released from incarceration with the general US and Connecticut populations, and modelled time-to-death from any cause after prison release with Cox proportional hazard models. FINDINGS:We identified 1350 people with HIV who were released after 24 h or more of incarceration between 2007 and 2014, of whom 184 (14%) died after index release; median age was 45 years (IQR 39-50) and median follow-up was 5·2 years (IQR 3·0-6·7) after index release. The crude mortality rate for people with HIV released from incarceration was 2868 deaths per 100?000 person-years, and the standardised mortality ratio showed that mortality was higher for this cohort than the general US population (6·97, 95% CI 5·96-7·97) and population of Connecticut (8·47, 7·25-9·69). Primary cause of death was reported for 170 individuals; the most common causes were HIV/AIDS (78 [46%]), drug overdose (26 [15%]), liver disease (17 [10%]), cardiovascular disease (16 [9%]), and accidental injury or suicide (13 [8%]). Black race (adjusted hazard ratio [HR] 0·52, 95% CI 0·34-0·80), having health insurance (0·09, 0·05-0·17), being re-incarcerated at least once for 365 days or longer (0·41, 0·22-0·76), and having a high percentage of re-incarcerations in which antiretroviral therapy was prescribed (0·08, 0·03-0·21) were protective against mortality. Positive predictors of time-to-death were age (?50 years; adjusted HR 3·65, 95% CI 1·21-11·08), lower CD4 count (200-499 cells per ?L, 2·54, 1·50-4·31; <200 cells per ?L, 3·44, 1·90-6·20), a high number of comorbidities (1·86, 95% CI 1·23-2·82), virological failure (2·76, 1·94-3·92), and unmonitored viral load (2·13, 1·09-4·18). INTERPRETATION:To reduce mortality after release from incarceration in people with HIV, resources are needed to identify and treat HIV, in addition to medical comorbidities, psychiatric disorders, and substance use disorders, during and following incarceration. Policies that reduce incarceration and support integrated systems of care between prisons and communities could have a substantial effect on the survival of people with HIV. FUNDING:US National Institutes of Health.