Baltimore leaders abruptly cast aside last night a state plan to rescue the city's nearly insolvent schools, offering a $42 million city loan intended to eliminate the need for strings-attached state help.

The move, which was initiated by City Councilman Keiffer J. Mitchell Jr., approved by the council and supported by Mayor Martin O'Malley, struck like a thunderbolt in Annapolis, where legislation calling for a virtual state takeover of the schools was about to be introduced.

"We're coming back to where we were a month ago, when the mayor first told us to pound sand," Gov. Robert L. Ehrlich Jr. said. "The system is on the brink of bankruptcy. We believe our bill would have, for the first time in a long time, built in the required oversight and accountability. We just hope this [city] bailout will work."

Soon after the council vote, Sen. Nathaniel J. McFadden, chairman of the city Senate delegation and a school system employee, rose on the floor of the Senate to tell his colleagues that the city would not be seeking a state loan.

"We are not saying we have all the money that we need, and we are not saying that we don't need the state," McFadden said. "But we are saying that the solution to the problems of Baltimore city starts with Baltimore City."

To the governor, the Senate president and speaker, he said, "Thank you, thank you from the bottom of our hearts. Pray for us as we go forward."

The announcement inspired an air of giddiness in Annapolis, where lawmakers seemed excited to get the issue off their plates. After his speech, McFadden exchanged high-fives with the chairman and vice chairman of the Budget and Taxation Committee.

In an extraordinary legislative twist, the City Council took up a bill that would have lent the city schools $8 million and, with no public notice, amended it, transforming it into a $42 million loan. The council approved the bill with one dissenting vote.

The city loan, which requires approval from the city's Board of Estimates, would eliminate the need for a state loan that came with a requirement for the city to cede more control to the state. Even more objectionable for many city leaders, it would have given the state the power to break the teachers' contract after this school year.

"Tell the state, 'We will take care of this. Thanks for the offer,'" Mitchell said.

O'Malley agreed, said spokesman Stephen Kearney.

"After a weekend of reflection and weeks of conferring with his finance staff, the mayor determined we can best solve the school's financial problems by taking more responsibility, not less," Kearney said.

Bonnie S. Copeland, the school system's chief exceutive officer, said yesterday that she had learned about the City Council loan offer too late in the evening to have had time to consider it.

"We really can't comment one way or the other on whether or not this is a viable option for the school system," Copeland said.

The city loan would negate a solution hashed out in weeks of politically charged negotiations between Ehrlich and O'Malley, considered likely rivals in the 2006 governor's race.

Mitchell's plan, which would substantially drain the city's rainy day fund, could go before the Board of Estimates as early as tomorrow.

Earlier in the evening, Kearney described the council's move as a backup plan to keep the schools afloat in case legislators in Annapolis rejected the state loan legislation, which was to be submitted yesterday.

"We're just planning for every possibility," Kearney said.

Senate President Thomas V. Mike Miller said he decided against introducing the state legislation last night after discussing the issue with O'Malley.