A settlement has been reached in a lawsuit brought by four Colorado inmates against state prison officials for allegedly not adequately treating them for hepatitis C virus (HCV). The $41 million settlement will ensure all affected prisoners will be treated for the disease, The Denver Post reports.

According to the settlement, all Colorado Department of Corrections (CDOC) inmates with chronic hepatitis C symptoms will be treated with new direct-acting antiviral medications over the next two years. Under this agreement, the state prison system will spend $20.5 million on hepatitis C treatment during this fiscal year and $20.5 million next year.

The original lawsuit had accused CDOC officials of denying lifesaving cures without medical justification to nearly 97 percent of state prisoners who need them. It cited a statement from the CDOC’s chief medical officer explaining that the department’s current health policy would mean prisoners would continue to die from hepatitis C, a highly treatable disease, for the next 10 years. It also alleged that CDOC officials knew that at least 2,280 prisoners had been diagnosed with HCV but didn’t do anything about it.

“We regard this settlement as a victory for all prisoners,” reads a letter written by Christopher Beall, one of the attorneys representing the four inmates.

In response to reports of the settlement, Mark Fairbairn, a CDOC spokesman said “the signed agreement does not include any monetary payout” from the prison system itself. Instead, state prison officials worked with the Colorado legislature to secure additional funding for hepatitis C medications—a potential example for other state prison systems aiming to expand access to HCV treatment.