The school board and some parents in Delaware County's Chester Upland School District filed suit in federal court today against the state, the education department and legislative leaders, asking that the district be adequately funded through the end of the school year, at a cost of about $20.7 million.

The money should come from state allocations normally due the district which are now being diverted to pay charter schools, the lawsuit said, and from state education department reserve funds.

State officials have repeatedly said they will not send money to the district, which they said caused its own problems through irresponsible spending.

The district, which saw big cuts in state education funding last June and which used money allocated for this year to pay debts it ran up last year, ran out of money last week and will not be able to meet its payroll Wednesday.

Almost half the district's students attend charter schools, with payments following the students, further contributing to Chester Upland's financial troubles.

The state has been withholding allocations that would normally go to Chester Upland to pay those charter schools that have Chester Upland students enrolled in them, and to repay itself $8.7 million it advanced to the district last year to pay off some of its debts for 2010-11. From January to June 2012, $36.3 million in state subsidies are due the district.

State officials have said they are obliged to pay the charters before sending any money on to the district, and that has used up all the state allegations. But the lawsuit cites a section of the School Code that says payroll obligations in school districts are "preferential claims."

State special education payments to Chester Upland this year are $3,600 per student, but the district has to pay charter schools $14,670 per special education student in addition to the rate it pays them for its regular education students, the lawsuit said. That violates special education law and equal protection provisions, the lawsuit said, and should be declared unconstitutional.

The lawsuit said that the state exercised receivership over the district from 2006 to June 2011, and failed to provide adequate oversight and direction to the district, which ran up millions in debt before an elected school board took over in June 2010. It asks that the state be enjoined from repaying itself the $8.7 million it advanced to the district until the end of this school year.

The lawsuit also said that because payments to charter schools are based on Chester Upland's 2010-11 budget, which was $17 million more than this year, payments based on the 2010-2011 spending levels should be halted unless Chester Upland's state funding is restored to that year's levels.

Contact staff writer Dan Hardy at 215-854-2612, dhardy@phillynews.com, or on Twitter @DanInq.