LANSING (AP) – The Michigan Legislature narrowly approved a $617 million bailout and restructuring of Detroit’s debt-ridden school district early Thursday, two years after the state spent less than a third of that amount to help the city government emerge from bankruptcy.

The legislation goes to Gov. Rick Snyder for his expected signature. The Republican-controlled Senate passed a main bill 19-18 late Wednesday, and the GOP-led House followed with a similar razor-thin 55-54 vote. Some Republicans joined all Democrats in opposition during an emotional debate that brought some lawmakers to tears.

Snyder, who had warned legislators that insolvency would be disastrous for students and the state if the district ran short of money this summer — as it would have without further intervention — said in a statement that the measure is a “fresh start” and an “unprecedented investment for the education of Detroit’s children.”

The financially and academically ailing 46,000-student Detroit Public Schools has been managed by the state for seven years, during which it has continued to face plummeting enrollment, deficits and, more recently, teacher sick-out protests.

Under the bills, the district would be split in two and control would be returned to an elected school board. A commission of state appointees would oversee the district’s finances, similar to how it now reviews the city’s budgeting as part of a $195 million state rescue in 2014.

The new debt-free district would educate students. The old district would stay intact for tax-collection purposes to retire $617 million in debt over 8½ years, including $150 million in transition costs to launch the new Detroit Community Schools.

Furious Democrats accused “coward” Republicans of bowing to the politically influential school-choice lobby in dropping a proposed commission of mayoral appointees to regulate the opening of new schools — including independent, publicly funded charters that have drawn students and funding away from traditional neighborhood schools.

Sen. Bert Johnson, a Highland Park Democrat who represents part of Detroit, said the legislation is “paternalistic” and “unethical.”

“If you do this, you are systematically spelling the end of the Detroit Public Schools system,” he said. “Parents are already concerned. … I think it’s going to drive enrollment further into the ground.”

But majority Republicans said bankruptcy would have been the worst possible outcome.

“I know many will weigh in with opinions on how we could have done better, and (we) all hear criticism about this compromise. But at the end of the day, our responsibility is to solve the problem,” said Senate Majority Leader Arlan Meekhof, a West Olive Republican.

The vote came more than a year after the Republican governor proposed an overhaul. He said debt was crushing the district and warned that insolvency would leave the state with billions of dollars in liabilities and stifle Detroit’s recovery post-bankruptcy.

Before the final voting, there had been fairly broad agreement on the need to help the district.

Yet Democrats united against the bills, expressing a range of concerns, including that the money would fall short of what is needed to adequately help the district decimated by declining enrollment — both due to population loss and the role of charter or suburban schools.

“This plan is a farce,” said Sen. David Knezek of Dearborn Heights.

Some Republicans were reluctant to offer taxpayer support to the state’s largest school district that for decades has grappled with mismanagement and corruption, while others joined with Democrats in contending that the legislation allows the continued pitting of district schools and charters against each other.

“My fear is that the serious lack of coordination related to school site planning decisions will continue,” said Sen. Goeff Hansen, a Hart Republican who choked up during his floor speech. He voted against some bills despite sponsoring and shepherding an earlier bipartisan package through the Senate.

“By not truly fixing these systemic problems, are we not furthering the confusion and chaos that negatively impacts parents’ abilities to seek stability and positive educational options for their children?” he said.

But House Speaker Kevin Cotter, a Mount Pleasant Republican, said lawmakers initially were asked to pay off the debt and hand back control of the district to locally elected officials.

“It does both of those things,” he said.

Copyright 2016 The Associated Press. All rights reserved. This material may not be published, broadcast, rewritten or redistributed.