BUFFALO, N.Y. — A city in upstate New York is now home to the nation’s first ever “opiate court” — a pilot program designed to help those arrested and addicted to opioids.

The new program, funded by a $300,000 grant from the Department of Justice, was announced Tuesday by the Buffalo City Court chief judge.

The opiate court is designed to get addicted defendants, who have been arrested for non-violent crimes, into treatment. In return, those who go through treatment may get a break on their criminal cases.

Two to three pending court cases in Buffalo have been closed with a death certificate every month. Defendants who are addicted often continue to use drugs, risking overdose and death.

The opiate court is funded for three years.