Birmingham's only British National Party councillor lost her seat on Wednesday after two judges ruled that she had "not been duly elected".
Sharon Ebanks is no longer a Birmingham councillor
They ruled some of the votes cast for Sharon Ebanks had been counted twice and that she had actually finished third in the local elections in May.
Judges announced that Labour candidate Catherine Grundy would replace her as councillor for Kingstanding ward.
The result could only be overturned in court where a recount was ordered.
The error emerged within minutes of the May election when it was realised that, according to the declared result, more than 12,000 votes had been cast.
But the number of ballot papers issued showed only around 9,900 votes could possibly have been cast.
Ms Ebanks was not present and was not represented at Wednesday's hearing.
Mrs Grundy said: "I'm looking forward to being sworn in as a local councillor so that I can legitimately push forward all the issues we need to address."
Mrs Grundy has been holding community surgeries and sitting in on council meetings despite not being declared a fully-fledged councillor.
Mr Justice Cooke, sitting with Mr Justice Jack, formally declared: "Miss Ebanks was not duly elected and Zoe Hopkins and Catherine Grundy were duly elected, in first and second place respectively."
The legal costs of the case are likely to run into tens of thousands of pounds.
Although the city council's returning officer was ordered to pay most of them, he is covered by an insurance policy.
Miss Ebanks had said that, if it turned out she had been wrongly elected, she would be "happy to pack her bags".
But she later made allegations of "electoral corruption" in the legal process and looks likely to be faced with a £5,000 legal bill.