NEW YORK -- The City Council today approved a roughly $66 billion budget that will reduce the number of public school teachers, lay off workers and cut back on caseworkers for the homebound elderly -- all while averting deep cuts that city leaders had argued were all but inevitable.

The vote, which formalizes the handshake agreement that Mayor Michael Bloomberg and City Council Speaker Christine Quinn reached Friday, ends a contentious budget season in which the mayor had said that severe cutbacks in city and state funding along with a struggling economy made it necessary for the nation's largest city to dial back core services and lay off more than 4,000 teachers.

Staten Island's City Council delegation voted "yes" to the budget, which was able to stave off the most draconian budget cuts predicted by the Bloomberg administration, saving borough firehouses and senior centers that were on the chopping block here.

In the end, though, lawmakers said they would not give the city's teachers their first pink slips since the economic crisis of the 1970s. Instead, the 2,600 public school teachers expected to quit or retire this year won't be replaced. Taken along with the attrition of the last two years, the change represents a loss of 1 out of every 12 instructors.

The city does plan to lay off about 1,000 nonuniformed employees, although officials have not yet revealed which agencies will be hit.

Those losses and others were enough to make City Councilman Charles Barron -- the lone dissenting vote on the financial plan -- insist his colleagues had been snookered by budgetary showmanship.

"They never were going to do that," he said of the worst of the cuts threatened in the mayor's initial budget plan. "That's a red herring -- to make you think you do have a victory when they put it back."

But Stephanie Gendell, associate executive director for advocacy group Citizens' Committee for Children, said that the budget's restored funding for children's programs represented real victories, even though several dozen child-care classrooms are still expected to close.

"We're very pleased, given where we started and given how bleak the economic situation seemed," she said.

Among the threatened programs that Gendell said had been saved were 257 government-subsidized preschool classrooms, day care offered at providers' homes for more than 2,700 kids and six day care centers.

Bloomberg has said that his threatened cuts were no bluff. The teacher layoffs were averted through union concessions on sabbaticals and substitute teachers, as well as Department of Education cutbacks and other administration measures, he has said.

Officials at the New York Public Library had thought they might be forced to shutter branches, lay off workers and reduce average hours from six to four days a week. But with the tens of millions of dollars received in the budget agreement, officials there now expect to be able to keep branches open and drop them on average to a five-day week.

The budget deal also means the city's children will be able to cool off in public pools. Previously, the mayor had planned to shutter four of them and close the rest two weeks early.

The lawmakers also found money to create a new senior center for gays and lesbians, as well as one for the visually impaired. The two will be part of a larger program to create 10 senior centers that provide a broader array of services than those found in traditional centers.

Funding for caseworkers who visit the homebound elderly will be cut more than 15 percent -- less than advocates had feared. Twenty fire companies that had been on the chopping block will stay open.

The cutbacks in the budget have prompted raucous protests in recent days. One group of protesters held court outside a council budget meeting Tuesday, and 13 people were arrested on charges of criminal trespass inside an office building used by the legislators, police said. One protester said the group had tried to stage a sit-in.