“I am sympathetic to these workers,” Mr. Walcott said. “But in part because other unions would not work with us to find more savings, schools have to absorb cuts to their budgets, and from there our principals made the best staffing decisions for their students.”

District Council 37 made three proposals to the city that included giving up paid holidays and reducing the maximum number of hours school aides were allowed to work as ways to save money. The city rejected all of them.

Union leaders, dressed in black as if in mourning, kept the pressure up until the last minute, holding a lunchtime rally Friday on the steps of City Hall to denounce the layoffs as political payback, a characterization city officials have dismissed.

For days, the leaders had been urging elected officials to intervene on behalf of the workers. Some of them took action. The City Council speaker, Christine C. Quinn, spoke to Mr. Bloomberg by phone, and 17 of the Council’s 51 members signed a letter to the mayor that said, “The constant attack on our education system will continue to burden the most vulnerable population of this city — our children.”

Officials at the Education Department, meanwhile, combed through the list of layoffs, seeking to match workers to vacancies at other schools. The process helped a small fraction of them, but with more cuts due, the relief may be short-lived.