Yew Tree Primary School, which is in Walsall but comes under the Sandwell Council authority, brought the judicial review against Education Secretary Gavin Williamson.
The decision to stop the primary school from becoming an academy has been hailed by a union leader as a positive step due to the "unnecessary distraction" the process would cause the school and its students.
The judicial review came after Mr Williamson failed to revoke an academy order imposed on the Birchfield Way school after it was rated "inadequate" by Ofsted in 2019.
The order to force the school to become an academy was made on April 9, 2019, with Shine Academies being approved as the sponsor of the school in July but no discussions were held.
Inspectors from Ofsted revisited the school in October and the school's grading was increased from "inadequate" overall to "requires improvement".
Jamie Barry, headteacher at the school, argued the school had made progress since then and would be rated "Good" if Ofsted were to inspect it again.
And because of this the governing body of the primary school requested the Education Secretary revoke the academy order on November 12, 2019.
It was refused on January 17 last year and a further request for revocation was refused by the National Schools Commissioner on February 28 last year.
Representations to the Education Secretary, who is also the MP for South Staffordshire, were made to state why the school met the exceptional circumstances needed to revoke the academy order.
It was sent on October 16 last year and further submissions were made by Sandwell Council who said they were "confident" the school would improve.
And despite these submissions, a decision was made on behalf of the Education Secretary on December 15 to refuse to revoke the academy order in place.
Solicitors on behalf of the school claimed it was "irrational" that the case did not amount to the "exceptional circumstances" needed to stop the order continuing.
It was argued in response that the decision cannot be said to be "irrational" due to the representations made by the claimant and the council being considered.
Gavin Mansfield QC, in a judgement on Friday, said that there was "clear evidence" from the school and the local authority of continued efforts to improve.
And Mr Mansfield QC said to suggest "the position had not substantially changed is, in my judgement, to disregard the evidence before it and is irrational".
In conclusion, he said: "For the reasons stated above, I have decided that the defendant's decision, on December 15, 2020, to refuse to revoke the academy order was irrational.
"I will make an order quashing that decision. I will deal with argument as to the appropriate form of order, and any consequential matters, at the hearing for hand down of judgment."
Jamie Barry, headteacher of Yew Tree Primary School, said: "Yew Tree have been on an incredible journey over the past two years and the improvements, due to the dedication and talent of everyone at the school, have been truly remarkable. I am pleased that the High Court have recognised the incredible efforts of the team and the support that we continue to receive from our local authority.
"I am pleased that the governing body of the school had the confidence in me and my team to challenge the decision taken in Westminster and I am grateful for the personal support that I have received from my union, the NAHT."
Paul Whiteman, general secretary of school leaders' union NAHT, praised the decision and said other schools were in similar situations.
He said: "For some schools converting to academy status is a positive step, for others it is an unnecessary and unhelpful distraction. We want schools to be able to succeed in their improvement journey and a big part of that is retaining the freedom to find the right type of support in their individual context.
"This case is important as the unnecessary disruption of a conversion would have been counter-productive and I congratulate the governing body in their successful attempt to bring clarity in this area.
"There are other schools in similar circumstances. The pandemic prevented Ofsted from visiting schools but that does not mean that improvement journeys have halted. I hope that this decision will bring sufficient reassurance to them that their efforts and success throughout the most difficult of years will not be disregarded."