A last-ditch effort to shed poor leadership in order to stay open did not pan out for a Brooklyn charter school that is millions of dollars in debt.

The school, Williamsburg Charter High School, would be the largest charter school to shut its doors. About 900 students will have to find spots in different high schools for the fall.

Department of Education officials cited deep financial and management troubles when they announced in January that Williamsburg Charter would close at the end of the school year. Last month, a lawyer hired by the school argued that the department’s concerns had been assuaged.

“I feel that we’ve met every issue they’ve raised,” Ellen Kimatian Eagan said at the time, noting that the school had severed relations with its controversial leader, who is under state investigation for financial improprieties. “We’ve made a lot of changes and we should remain open.”

But department officials determined that the changes had come too late to instill confidence that the school really had severed ties with its management organization, Believe Charter Schools, which is also under state investigation. The school is about $5 million in debt, city officials concluded.

“Time and again, this school has failed to live up to the conditions we set when concerns arose over their management and finances,” Chancellor Dennis Walcott said in a statement. “We hold charter schools to the highest standards — and in a case like this, where a school has been given multiple opportunities but still failed to implement oversight and accountability, we need to take action.”

Deputy Chancellor Kathleen Grimm, who heard the appeal, detailed the department’s reasoning in a nine-page letter to its board today. That letter is below.

The school will close at the end of June and its remaining students — about 900 — will disperse among other city high schools. City officials said they would offer the students spots in schools that still have seats open after the regular admissions process — meaning that they are likely to wind up in schools with significant challenges.

Students from another school that used to be in the Believe Network, Believe Southside Charter School, will also have to find new schools because the state has revoked that school’s charter. The state is allowing the network’s third school, Believe Northside, to stay open on a conditional basis.