CHICAGO (CBS) — Accusing Mayor Rahm Emanuel of “incompetent and uncaring mismanagement” of the Chicago Public Schools, and using a “kangaroo court” to try to dismiss him as principal of Blaine Elementary, Troy LaRaviere has announced his resignation in a blog post.

LaRaviere, who was removed as principal of Blaine in April, amid allegations of misconduct, said he was resigning to clear the way for a permanent replacement.

Two months ago, LaRaviere was elected as president of the Chicago Principals and Administrators Association. He said taking that position makes it impossible to return as principal of Blaine, regardless of what happens with the disciplinary proceedings against him.

“Meanwhile, the Blaine school community cannot move forward and hire another permanent principal until my case is resolved. I cannot allow those for whom I have worked so hard in the last five years to suffer the consequences of your destructive political agenda,” LaRaviere wrote.

LaRaviere noted Blaine recently was named the best neighborhood school and the third-best public school in Chicago, and he said he hoped in his five years there, CPS would have learned from Blaine’s example to help other schools improve.

“One might think that after witnessing the unprecedented academic gains of Blaine students, you and your appointees might call on my school leadership team to help you understand how we improved at such an incredible rate. Instead, at your direction, your appointees are pushing forward with efforts to terminate my employment. It is clear that I am being punished for my advocacy, and that this retribution is more important to you than effective public education for Chicago’s children,” he wrote.

CPS officials have not publicly explained why LaRaviere was removed from his post, other than accusing him of “alleged actions of misconduct,” and saying he violated a previous warning by the Chicago Board of Education. An August 2015 reprimand of LaRaviere amounted to a formal censure, and it is often a first step in a process that could end in termination.

LaRaviere has called the misconduct allegations a “false justification” to fire him for his frequent criticism of Emanuel and his hand-picked school board.

“The hearing process is, of course, a kangaroo court that ends with a determination by your appointed school board; the very school board that voted to censure me in the first place. I don’t expect your appointed board to deliver justice any more than I expect it to practice fiscal responsibility or competent educational management,” LaRaviere wrote Tuesday.

LaRaviere said he was accused of insubordination, dereliction of duty, and ethics violations tied to his public support for presidential candidate Bernie Sanders and Jesus “Chuy” Garcia, who ran against Emanuel last year. He called the to fire him an act of political retribution.

“With the above factors in mind, I hereby resign my position as principal of Blaine Elementary School. However, my efforts to reverse your poor fiscal and educational management of our school system are just getting started,” LaRaviere wrote.

CPS officials did not respond to LaRaviere’s criticisms, but said they’re confident Blaine will continue to be one of the city’s top-performing schools.

“Families at Blaine Elementary School can look forward to another excellent school year, building on their gains of the past decade. With schools throughout Chicago seeing landmark improvements, we are optimistic that this will be a banner year for all our students,” CPS spokeswoman Emily Bittner said in an email.