Controversial plans to shut down a Welsh-language primary school in a Denbighshire village have been struck down by the High Court.
Ysgol Pentrecelyn was to be closed and merged with another school on a purpose-built new site.
Denbighshire County Council planned to close 56-pupil Ysgol Pentrecelyn, near Ruthin, where Welsh is both the language of the classroom and the schoolyard.
Larger dual-language school, Ysgol Llanfair Dyffryn Clwyd, was also to close before the two schools merged on a purpose-built new site.
Campaign group Ymgyrch Pentrecelyn has been fighting to keep the Welsh medium school.
This case is the first ever judicial review of a decision to close a Welsh-language primary school.
The proposals to create a bilingual school in favour of a Welsh medium school caused uproar in the local community who started a campaign which had the backing of former pupil and Hollywood A-lister, Rhys Ifans.
Giving his decision in both Welsh and English, Mr Justice Hickinbottom said the consultation process leading up to the decision was fatally flawed.
It was "curious and artificial" of the council to only consult residents on phase 1 of the project - which would see both schools closed and re-opened on their existing sites.
Locals were given no information about the "risks in terms of adverse language and community impact" of phase 2, the planned permanent move to a new site.
The court's decision sends the council back to the drawing board and it must now carry out a fresh consultation before reaching a new decision.
The schools, which have fewer than 170 pupils between them, are just two miles apart.
The judge concluded there was nothing wrong with the council making it "abundantly clear" that its "preferred option" was for a dual-language voluntary controlled church school.
But local residents were entitled to have their say and had not been lawfully consulted, the judge concluded.
The decision was quashed and the council was ordered to pay the £15,000 legal costs of the case.
Denbighshire County Council has expressed its disappointment at the outcome of a judicial review.