Importance: Safety-net hospitals (SNHs) operate under limited financial resources and have had challenges providing high-quality care. Medicaid expansion under the Affordable Care Act led to improvements in hospital finances, but whether this was associated with better hospital quality, particularly among SNHs given their baseline financial constraints, remains unknown., Objective: To compare changes in quality from 2012 to 2018 between SNHs in states that expanded Medicaid vs those in states that did not., Design, Setting, and Participants: Using a difference-in-differences analysis in a cohort study, performance on quality measures was compared between SNHs, defined as those in the highest quartile of uncompensated care in the pre-Medicaid expansion period, in expansion vs nonexpansion states, before and after the implementation of Medicaid expansion. A total of 811 SNHs were included in the analysis, with 316 in nonexpansion states and 495 in expansion states. The study was conducted from January to November 2020., Exposures: Time-varying indicators for Medicaid expansion status., Main Outcomes and Measures: The primary outcome was hospital quality measured by patient-reported experience (Hospital Consumer Assessment of Healthcare Providers and Systems Survey), health care-associated infections (central line-associated bloodstream infections, catheter-associated urinary tract infections, and surgical site infections following colon surgery) and patient outcomes (30-day mortality and readmission rates for acute myocardial infarction, heart failure, and pneumonia). Secondary outcomes included hospital financial measures (uncompensated care and operating margins), adoption of electronic health records, provision of safety-net services (enabling, linguistic/translation, and transportation services), or safety-net service lines (trauma, burn, obstetrics, neonatal intensive, and psychiatric care)., Results: In this difference-in-differences analysis of a cohort of 811 SNHs, no differential changes in patient-reported experience, health care-associated infections, readmissions, or mortality were noted, regardless of Medicaid expansion status after the Affordable Care Act. There were modest differential increases between 2012 and 2016 in the adoption of electronic health records (mean [SD]: nonexpansion states, 99.4 [7.4] vs 99.9 [3.8]; expansion states, 94.6 [22.6] vs 100.0 [2.2]; 1.7 percentage points; P = .02) and between 2012 and 2018 in the number of inpatient psychiatric beds (mean [SD]: nonexpansion states, 24.7 [36.0] vs 23.6 [39.0]; expansion states: 29.3 [42.8] vs 31.4 [44.3]; 1.4 beds; P = .02) among SNHs in expansion states, although they were not statistically significant at a threshold adjusted for multiple comparisons. In subgroup analyses comparing SNHs with higher vs lower baseline operating margins, an isolated differential improvement was noted in heart failure readmissions among SNHs with lower baseline operating margins in expansion states (mean [SD], 22.8 [2.1]; -0.53 percentage points; P = .001)., Conclusions and Relevance: This difference-in-differences cohort study found that despite reductions in uncompensated care and improvements in operating margins, there appears to be little evidence of quality improvement among SNHs in states that expanded Medicaid compared with those in states that did not.