As expected, a Common Pleas Court judge issued a written ruling yesterday that keeps open all city libraries.

But unexpected was a message from the library director to branch librarians warning of possible multiple closures and layoffs. And some of her predictions apparently came to pass - four branches closed because of a lack of staffing.

The decision by Judge Idee C. Fox followed her oral ruling from the bench last week, when she enjoined the city from closing 11 of the 54 branch libraries unless the Nutter administration gets approval from City Council.

The administration planned to shutter the 11 branches on Dec. 31 to help save $8 million a year for the city, now struggling to deal with a projected $1 billion five-year budget deficit.

In her written ruling yesterday, Fox said, "The decision to close these 11 branch libraries is more than a response to a financial crisis; it changes the very foundation of our city."

She added, "Our library system is more than a century old, yet in three short months an economic crisis results in permanently closing 11 branches."

In strong language, Fox cited a city ordinance that says the mayor must ask Council approval to close city buildings.

"This court does not envy the mayor and the tough decisions he has had to make in this financial crisis. Yet, as this court is bound to follow the law, so is the mayor."

City Solicitor Shelley Smith said the administration would appeal the decision.

Earlier in the day, Smith met with the judge and opposing counsel to ask her to reconsider her oral ruling. Fox denied the city's request, upholding her original ruling in favor of seven library patrons, the union representing library workers, and three Council members who sued Nutter based on the 20-year-old ordinance.

In the meantime, Siobhan R. Reardon, president and director of the Free Library of Philadelphia, indicated in an e-mail sent to branch librarians yesterday that the city may have difficulty coping with Fox's order, which could force more layoffs and closings.

"With the reopening of the libraries, we have to restore the budgets for library materials, etc. and eventually will have to lay off additional positions," Reardon wrote.

She added that at least 20 libraries may endure emergency closings this week due to staffing shortages.

Nutter administration spokesman Doug Oliver said last night that Fox's order would make staffing at even minimal levels difficult.

Library staffing was reduced by 40 employees in anticipation of closing the 11 branches, Oliver said.

He added that four branches were closed yesterday because not enough staffers were on hand to keep them open: the Durham, Paschalville, Wyoming and McPherson Square branches.

"If you're spread so thin and somebody catches a cold and can't come in to work, you will have emergency closures," Oliver said.

In her e-mail, Reardon also said that all libraries were open Friday and Saturday "through the use of overtime."

Oliver confirmed that, saying that the city finds itself in the paradoxical situation of paying more to keep open branches it had planned to close in order to save money.

He said that, in order to comply with Fox's ruling, the library administration was contemplating keeping each branch open just three days a week.

Oliver said the city had considered that option but rejected it because it would weaken the system as a whole. "This is the worst of all possible outcomes."

City Councilman Bill Green - one of the Council members who sued Nutter - said, "I'm pleased the judge agreed with our position on the law, and I look forward to working with the mayor to try to resolve our financial crisis."

Amy Dougherty, executive director of the Friends of the Free Library, said she hoped the ruling provided her group with more time "to come up with a solution that will convince the mayor and the library administration that the taxpayers of Philadelphia do not want permanent library closures."

Irv Ackelsberg, the legal-services lawyer who brought the suit, chided Nutter yesterday, saying, "I've never heard any reason why he can't go to City Council [to ask for library closures], which is all the judge ordered. He just has to follow the law and he doesn't want to do that. I don't know why."