The federal government said it reached an agreement to drop charges against a Massachusetts state judge, who allegedly helped block an undocumented immigrant’s arrest, in exchange for her referring herself to a panel that investigates judicial misconduct.

In a filing Thursday, the Office of U.S. Attorney for the District of Massachusetts moved to dismiss charges against Newton District Court Judge Shelley Joseph, who was accused of helping a defendant evade federal immigration authorities in 2018. The government said Joseph agreed to refer herself to the Massachusetts Commission on Judicial Conduct to face misconduct allegations and potential discipline.