The Michigan Legislature on Thursday approved a $617 million bailout and restructuring of Detroit schools in an effort to save the debt-ridden school district from bankruptcy.

The Republican-majority Senate passed a main bill voting 19-18 on Wednesday, followed by a bare minimum 55-54 vote at the GOP-led House. Gov. Rick Snyder is expected to sign the legislation soon.

West Olive Republican and Senate Majority Leader Arlan Meekhof described the legislation as a “realistic compromise” in spite of fierce opposition from Democrats, including those who represent city residents, the Associated Press reported.

“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,” he said, “There are more than 45,000 students who depend upon Detroit Public Schools and deserve a stable, quality education option.”

As per the legislation, the district will be split in two with an elected school board put in control and a commission of state appointees overseeing the district’s finances. Students will be educated in the new debt-free district while the old district will remain largely intact to collect tax to pay back the $617 million over a period of eight and a half years. The old district will also have to repay the $150 million in transition costs to launch the new Detroit Community Schools.

Democrats united against the legislation accusing Republicans of bowing down to pressure from the politically influential school-choice lobby instead of passing one that would have stabilized the district in the long term.

Sen. Morris Hood III of Detroit reportedly called the GOP majority a “coward” and questioned the absence of Detroit legislators in the negotiation process. Sen. Bert Johnson of Highland Park called the deal “unethical” and “paternalistic.”

“If you do this, you are systematically spelling the end of the Detroit Public Schools system,” Johnson said. “Parents are already concerned that what they hear about their school district is enough that I think it's going to drive enrollment further into the ground.”

The state had been controlling the financially and academically weak Detroit Public Schools for seven years. During this period, enrollments have continued to fall and the district recently witnessed teacher sick-out protests.

This bailout comes two years after the state spent money to help the city government emerge from bankruptcy. Reports say that the state’s largest school district has grappled for decades with corruption and mismanagement.