Details were still being worked out, but the agreement calls for concessions from the United Federation of Teachers and money from the Council.
Under the deal, the union would agree to suspend teacher sabbaticals for a year and permit teachers without a permanent assignment to be used more regularly as classroom substitutes. In addition, the Bloomberg administration would concede that 2,600 teachers would be lost to attrition, 600 more than estimated, saving additional jobs. On one hand, the resolution spares Mr. Bloomberg from becoming the first mayor in nearly 40 years to impose mass teacher layoffs. On the other hand, though, it threatens to undermine his credibility, given that he has declared for two consecutive years that layoffs were inevitable, only to see them averted in a budget deal.
The budget plan also allows the Council to keep open 20 fire companies that the mayor had ordered closed, and it may be able to restore at least some of the cuts he planned for day care services and librarians.
Still, it appeared that up to 1,000 city workers — many of them in health care jobs — would be laid off.
In a news conference at the Education Department headquarters in Lower Manhattan on Friday night, Mr. Bloomberg said he was disappointed he could not avoid all layoffs. Still, he said, “this is a budget that will keep our city strong, but it is also a budget that faces fiscal reality.”
Asked whether he thought his credibility had been hurt, the mayor defended his approach, saying the city faced extremely bleak and unpredictable economic circumstances.
The City Council speaker, Christine C. Quinn, standing by the mayor’s side, praised the deal. “New Yorkers can rest easy tonight knowing that our children will still have great teachers,” she said.
Mr. Bloomberg had taken an aggressive posture during the negotiations, emboldened over the past days by the victories scored in Albany and Trenton against public-sector unions and becoming more emphatic about his demands. But in the end, he and the teachers’ union, one of his most vociferous opponents, had to reach an agreement, helping to balance a $66 billion budget that had a $4.6 billion gap.
A different rescue proposal fell apart on Thursday, after the city rejected an offer from the Municipal Labor Committee, a group representing roughly 100 municipal unions, for $262 million to be taken from a health care reserve fund they jointly manage. By then, Ms. Quinn and the teachers’ union president, Michael Mulgrew, had been secretly meeting for days.
Once the other deal collapsed, talks between Ms. Quinn and Mr. Mulgrew moved into overdrive.
On Friday morning, officials of the city’s Education Department made their way to the union’s headquarters to determine what would and would not be on the table. By late afternoon, the two sides had come to an agreement.
Ms. Quinn, meanwhile, worked to sell the plan to Mr. Bloomberg, emerging as the crucial figure in the process.
The budget must be approved by the full Council by Thursday.
Javier C. Hernandez contributed reporting