PHILADELPHIA (CBS) — The state supreme court has given the Philadelphia School District a major victory, ruling that the district is allowed to enforce caps on charter school enrollment. The ruling allows the district to keep some control over charter costs.

The ruling came in the case of Discovery Charter School, which had agreed to enroll a maximum of 620 students when it was chartered but wanted to increase that to over a thousand. The school district, in the midst of a financial crisis when the charter was up for renewal, refused to pay for any additional students.

READ: Advocates Call On School Reform Commission To Dissolve Itself

Charter school payments are made on a per-student basis and the district estimates it loses $7,000 for every student who attends a charter.

Discovery prevailed in two lower courts, raising the specter that the district would have no control over how much of its budget was eaten up by charter payments, but in a unanimous decision, the supreme court ruled that Commonwealth Court had erred in its interpretation of the charter school law. Discovery, it suggested, could apply for a new charter that includes an increased student enrollment.

Neither Discovery Charter School nor the School District of Philadelphia responded to requests for comment.