A bill that would require courts to notify immigrant defendants that a plea deal to criminal charges could lead to their deportation is heading to Gov. Kathy Hochul's desk.

The measure is meant to address a federal law that requires legal immigrants and residents be subject to removal from the U.S. if they plead guilty to criminal charges. Many of those charges are considered minor offenses under New York's criminal code, lawmakers who back the legislation argue.

Immigrants could also face deportation for pleading guilty to charges that do not result in an automatic conviction, such as drug charges.

The measure has been given final approval this week by both chambers of the Democratic-controlled Legislature. It now heads to the governor for her consideration.

“Many immigrants come to America to escape persecution, torture, and certain death. It is only right and just for the courts to warn them that pleading to a crime could lead to their deportation and the very fate they fought to escape," said Sherry Levin Wallach, the president of the New York State Bar Association. "I applaud the state Legislature for taking this sensible and humane step to improve our system of justice and urge Gov. Kathy Hochul to sign the bill into law.”