The de Blasio administration enacted the rule in August to reduce traffic congestion in Manhattan.

It was a called a cruising cap, limiting how much time Uber and Lyft drivers could travel around busy parts of the city without passengers.

But less than two months before the rule was to take effect, it's been struck down by a State Supreme Court judge calling it "arbitrary" and "capricious."

Uber and Lyft drivers now spend 41 percent of their time without passengers south of 96th Street. The new Taxi and Limousine Commission rule would have reduced that to 36 percent by February and to 31 percent by August.

In his ruling, Judge Lyle Frank said:

"The court agrees with the petitioners that this rationale is simply insufficient, as the numbers should have been derived at as a result of the review undertaken, and not as a starting point."

Uber hailed the decision, calling the cruising cap politically motivated and suggesting it would not actually combat congestion.

But the Mayor's office was defiant, saying,

“These corporations have flooded our streets with so many cars that more than 40% drive around empty and clog our streets. These 85,000 new vehicles create significant environmental problems, as well as make it a headache for New Yorkers to get around the City in a timely fashion. We put these rules in place to protect hardworking drivers and New Yorkers—and we’ll fight to keep them."

Even supporters of a crackdown on e-hailing said the rule needed to be tweaked. The Taxi Workers Alliance said Uber and Lyft were punishing drivers by knocking them out of their apps, to pay them less and make it seem like there were fewer idle drivers.

“Before we even get to the implementation of the cruising cap the TLC has needed to find a way to address these log offs and to stop the manipulation by these companies,” said Bhairavi Desai of the New York Taxi Workers Alliance.

The city says it is considering an appeal.