DETROIT (AP) — The Detroit teachers' union filed a lawsuit against the district Thursday calling for repairing "deplorable" conditions and removing the state-appointed emergency manager that they hold responsible.

The suit the Detroit Federation of Teachers filed in Wayne County Circuit Court seeks "an appropriately funded capital plan" to fix districtwide problems and calls for removing Emergency Manager Darnell Earley, also named in the lawsuit, and returning to local control.

It alleges that the district under Earley's control "has not performed its duty to its students, parents, teachers, and community to provide a minimally adequate education and to properly maintain the schools."

"Instead, defendants have allowed the physical condition of Detroit's schools to deteriorate to the point of crisis and have forced Detroit's school-age children to spend their young lives in deplorable surroundings risking their health and safety in the process and imposing on students and their teachers an atmosphere that interferes with their securing a minimally sufficient education," the lawsuit reads.

Earley said in a statement Thursday the district is "committed to ensuring ... students and staff have a safe working and learning environment." He said many issues raised in the lawsuit would be handled in Gov. Rick Snyder's 10-year, $715 million plan that seeks to help the district emerge from debt. However, Snyder's plan has yet to receive support in the Legislature — even from fellow Republicans.

Rolling teacher sick-outs in the Detroit Public Schools have forced the closing of dozens of schools some days. A judge this week denied the district's second attempt at a temporary restraining order against the sick-outs over poor pay, crowded classrooms, unsafe buildings and other issues, including mold and rodent infestations.

The union previously said it doesn't condone educators' actions involved in the sick-outs, but the lawsuit says the actions and others taken by teachers came after "internal complaints and reports were ignored."

The union's suit calls for the district to fix numerous code violations. It says city inspectors visited 11 schools and found an average of 14 violations per building.

Earlier this month, Mayor Mike Duggan toured some schools and said he saw a dead mouse, children wearing coats in cold classrooms and a gym floor too warped for play. Although he is not in charge of the schools, Duggan pledged to quickly come up with a plan to improve the condition of the buildings.

"Our children need our teachers in the classroom. ... But there's no question about the legitimacy of the issues that they're raising," he said.

An audit filed Nov. 2 with the state put Detroit Schools' annual budget deficit at $46.5 million. Snyder has said that the district's debt will reach about $515 million by this summer.

District revenues are tied to per-pupil funding from the state, and Detroit receives about $7,400 for each student. The problem is that the district's enrollment has decreased by more than 100,000 during the past dozen years.

In 2003-04, the Detroit Public Schools had 150,415 students. Enrollment now stands at about 46,000. The drop reflects the city's population loss — more than 950,000 people lived in Detroit in 2000, compared to the current population of about 690,000.

Competition from charter schools inside Detroit and from neighboring districts also has cut into the district's enrollment numbers.

Detroit's schools have been under state oversight since 2009. Earley is the district's fourth emergency manager over that time. His predecessors have closed aging buildings and academically underperforming schools, but many others are in poor physical condition and the school district is too short of money for major fixes.

Among those joining the Detroit union in the lawsuit is its parent organization, the American Federation of Teachers. AFT President Randi Weingarten said Thursday that "there's always money to be found" to make necessary fixes. She also defended the call to oust Earley.

"It's always excuse, excuse, excuse, as opposed to rolling up your sleeves and trying to fix the problem," she said.