The Mayor of London and Transport for London acted unlawfully in a road scheme which restricted licensed taxis, the High Court has ruled.
The "Streetspace" scheme introduced bus-only corridors, which banned turns and stopped access to taxi drivers across central London in May.
Mrs Justice Beverley Lang ruled Sadiq Khan and TfL "took advantage of the pandemic" to push "radical changes".
TfL said it was "disappointed" and it would appeal the ruling.
The scheme was introduced to lower car traffic in response to the coronavirus pandemic, TfL said.
Taxi unions and associations raised concerns over the "Streetspace" plans after they said they would lose their bulk of trade with restricted access to Low Traffic Neighbourhoods from 6 May 2020.
'Unfair and irrational'
The case was brought by United Trade Action Group (UTAG) and the Licensed Taxi Drivers Association (LTDA).
Mrs Lang told the court the mayor and TfL failed to distinguish taxis from "general traffic" and failed to recognise them as a mode of public transport.
She said: "It was both unfair and irrational to introduce such extreme measures, if it was not necessary to do so, when they impacted so adversely on certain sections of the public."
The High Court has now quashed the "Streetspace" plan, Interim Guidance to Boroughs and the A10 Bishopsgate Traffic Order.
General Secretary of the LTDA, Steve McNamara, said he was "delighted".
He said: "It's fantastic to see the Judge rightly recognising the key role licensed taxis play in our great City. This is an extremely important judgement for London's hard working taxi drivers and the passengers who rely on them."
Analysis - Tom Edwards, BBC London's transport correspondent
Broadly, cities have been trying to keep vehicles out of certain areas to try and reduce congestion and pollution.
In London, that accelerated under the "Streetspace" scheme during the pandemic to give people more space to cycle and walk.
However, a judge today was withering in how this was done - it was unlawful.
Crucially, taxis were kept out of some schemes where they had a legitimate expectation to be able to go - especially Bishopsgate.
Mrs Lang said TfL and the mayor's decision making was seriously flawed, the response was ill-considered and they were taking advantage of the pandemic.
Crucially, she said the "Streetspace" plan would now have to be reconsidered and seriously amended.
All of which muddies the waters for these types of schemes.
Those who support making cycling and walking easier and safer will be bitterly disappointed.
TfL said it would seek to appeal the judgment.
A spokesperson said: "Temporary 'Streetspace' schemes are enabling safer essential journeys during this exceptionally challenging time and are vital to ensuring that increased car traffic does not threaten London's recovery from coronavirus."
A Mayor of London spokesperson said the "Streetspace" route had "long suffered with a poor safety record and slow bus speeds".
They added: "We mustn't get through one public health crisis only to face another caused by congestion and toxic air pollution."