NEW YORK (AP) — New York City intends to wipe out more than $2 billion in medical debt for up to 500,000 residents, tackling a top cause of personal bankruptcy, Mayor Eric Adams announced Monday.

The city is working with RIP Medical Debt, a nonprofit that buys medical debt in bulk from hospitals and debt collectors for pennies on the dollar. The group targets the debt of people with low incomes or financial hardships and then forgives the amounts.

Under the program, the city will spend $18 million over three years.

"For middle- and working-class New Yorkers, medical bills can be financially devastating," Adams said as he announced the plan. "Working-class families often have to choose between paying their medical bills or some of the basic essentials that they need to go through life."

The mayor said medical debt is the No. 1 cause of bankruptcy in the United States, disproportionately burdening low-income households and people with inadequate insurance. He called the debt relief program the largest municipal initiative of its kind in the country, though RIP Medical Debt has worked with other municipalities.

RIP Medical Debt president and CEO Allison Sesso said there will be no application process for the program. Relief recipients will be notified that their debt has been bought by a third party and erased.

Though New York City is facing financial strains, Adams said the $18 million commitment over three years is a great investment for the city.

"If you are able to ... save $2 billion in debt, that $2 billion trickles down to those households, who are not going to fall into our safety net," he said. "They're not going to fall into our homeless system."