NEW YORK — New York City’s Board of Elections agreed this week to change how it manages voter registration rolls following complaints and an investigation into the removal of 200,000 voters before last year’s presidential primary.

Under a legal settlement with state and federal authorities, the board will overhaul its procedures for purging voters, submit to monitoring, and agree to restore the names of voters who were improperly removed.

“The right to vote is sacred to our democracy. Yet the NYC Board of Elections illegally purged over 200,000 New Yorkers from the rolls, violating the law and New Yorkers’ trust in the institutions meant to protect their rights,” state Attorney General Eric Schneiderman, a Democrat, said Wednesday.

The Department of Justice, the U.S. attorney’s office in Brooklyn and Schneiderman’s office announced the agreement.

About 200,000 voters were stricken from the rolls before the 2016 primary, prompting widespread complaints, a lawsuit and investigations by the U.S. Department of Justice and Schneiderman’s office. Officials determined that the agency removed some voters from the rolls solely because they hadn’t participated in recent elections — a practice prohibited by federal law.

Election officials routinely review the voter registration rolls to remove the names of voters who have died or moved. Schneiderman’s office said the legal settlement will help ensure officials don’t go too far and remove the names of eligible voters.

A spokeswoman for the board said the agency has no comment on the settlement, which is subject to court approval.