A vacant classroom at Southwestern High School in Detroit in 2015. (Carlos Osorio/AP)

The Michigan legislature has narrowly approved a $617 million package to bail out and restructure the troubled Detroit public school system, which is expected to run out of cash at the end of June.

A majority of Republican lawmakers passed the plan early Thursday morning over fierce and unanimous opposition from Democrats, who said that the plan’s failure to more tightly regulate charter schools — and its embrace of uncredentialed teachers in city schools — would fail to stop the Detroit school system’s decline.

The rescue plan would send $467 million to Detroit Public Schools in order to deal with the system’s debt, according to the Associated Press. An additional $150 million would be used to start a new district, which would be responsible for educating children. That district would be led by an elected board, returning city schools to local control after seven years of state management.

The Senate approved the package with a 19-18 vote late Wednesday night, and the House followed early Thursday, voting 55-54 in favor, according to the Associated Press.

The package is expected to be signed into law by Gov. Rick Snyder (R), who hailed it as an “unprecedented investment for the education of Detroit children” that would finally put the long-struggling system on a path to solvency.

The rescue plan calls for Detroit to vote for a new local school board in November, and for school board members to take office in January. A state-appointed Financial Review Commission would oversee the district’s finances.

And schools would be assigned a letter grade every year based on students’ test scores and other measures of performance. Any school that gets an “F” three years in a row must be closed, according to the bills, unless the closure would cause “unreasonable hardship” for students.

The financial problems in Detroit schools have been fueled by mismanagement and dramatic enrollment decline, from a peak of near 300,000 in 1966 to just 46,000 today. Fast-growing charter schools have increasingly contributed to the enrollment decline; they now enroll 41 percent of the city’s students.

Currently, charter schools can open with the approval of any one of a number of independent authorizers, such as universities, and there is little coordinated planning about which schools should be allowed to open and where they will be located. Many Detroiters and state Democrats believe that any school rescue package needed to bring order to that freewheeling process by more firmly controlling where and when new schools could open.

Mayor Mike Duggan (D) and Snyder, the GOP governor, both favored creating a Detroit Education Commission that would oversee both traditional and charter schools, deciding which schools could open and where, and which schools must close.

But charter-school advocates in Michigan opposed that idea, saying it would open the process to political machinations. And, to Democrats’ distress, the package passed Thursday omitted the Detroit Education Commission, instead creating an advisory council to issue annual reports on the condition and siting of school facilities.

Democrats also did not like a provision that would allow the newly elected school board to hire teachers who are not credentialed, saying it amounts to approving a lower-quality education for Detroit children.

Teachers union leaders also decried the plan, saying it not only would allow inexperienced and unlicensed teachers into the classroom, but would not provide enough funding and would ratchet up the pressure to score well on standardized tests.

The package allows teachers to keep their union representation and current collective bargaining agreements. But in a shot at teachers unions, it also requires state officials to take quicker action in cases of alleged illegal strikes, and it adds language about fines for teachers who engage in illegal strikes.

Those measures come in the wake of what GOP leaders have called a series of illegal strikes by Detroit teachers. Teachers staged a series of sickouts in the school year, shutting down schools to draw attention to the condition of Detroit’s crumbling school buildings and to the prospect that — because of the district’s financial crisis — teachers might not be paid for their work.

Finally, the package specifies that salaries for new hires should be determined not by length of service but by job performance, including measures of student achievement.