ImportanceFew interventions are proven to reduce total health care costs, and addressing cost-related nonadherence has the potential to do so.ObjectiveTo determine the effect of eliminating out-of-pocket medication fees on total health care costs.Design, Setting, and ParticipantsThis secondary analysis of a multicenter randomized clinical trial using a prespecified outcome took place across 9 primary care sites in Ontario, Canada (6 in Toronto and 3 in rural areas), where health care services are generally publicly funded. Adult patients (≥18 years old) reporting cost-related nonadherence to medicines in the past 12 months were recruited between June 1, 2016, and April 28, 2017, and followed up until April 28, 2020. Data analysis was completed in 2021.InterventionsAccess to a comprehensive list of 128 medicines commonly prescribed in ambulatory care with no out-of-pocket costs for 3 years vs usual medicine access.Main Outcome and MeasuresTotal publicly funded health care costs over 3 years, including costs of hospitalizations. Health care costs were determined using administrative data from Ontario’s single-payer health care system, and all costs are reported in Canadian dollars with adjustments for inflation.ResultsA total of 747 participants from 9 primary care sites were included in the analysis (mean [SD] age, 51 [14] years; 421 [56.4%] female). Free medicine distribution was associated with a lower median total health care spending over 3 years of $1641 (95% CI, $454-$2792; P = .006). Mean total spending was $4465 (95% CI, −$944 to $9874) lower over the 3-year period.Conclusions and RelevanceIn this secondary analysis of a randomized clinical trial, eliminating out-of-pocket medication expenses for patients with cost-related nonadherence in primary care was associated with lower health care spending over 3 years. These findings suggest that eliminating out-of-pocket medication costs for patients could reduce overall costs of health care.Trial RegistrationClinicalTrials.gov Identifier: NCT02744963