New York will become the nation’s first major metropolis to close its public schools in observance of the two most sacred Muslim holy days, Mayor Bill de Blasio said on Wednesday, a watershed moment for a group that has endured suspicion and hostility since the Sept. 11 attacks.

Several municipalities across the country — including in Massachusetts, Michigan and New Jersey — have moved in recent years to include the holy days, Eid al-Fitr and Eid al-Adha, in their school calendars. But New York City, with its 1.1 million schoolchildren, dwarfs the others in its size and symbolism.

Mr. de Blasio, a Democrat who has pledged a more tolerant and inclusive city, described the policy that begins in the coming school year as a simple “matter of fairness.” But the announcement was all the more striking for its timing, as Muslim-Americans face fresh scrutiny in the wake of terrorist attacks in Europe and new violence in the Middle East.

In January, Duke University abruptly canceled plans to start broadcasting the Muslim call to prayer from the school’s chapel bell tower after threats of violence. And the shooting deaths of three Muslims last month in North Carolina prompted fears about an anti-Muslim backlash. Last week, three Brooklyn men were arrested and charged with plotting to join the Islamic State terrorist organization; two of them lived four miles from the public school where Mr. de Blasio unveiled his new policy.