(Reuters) - A New York state judge on Monday ruled in favor of Uber Technologies Inc and Lyft Inc in a lawsuit against New York City, striking down a new rule limiting how much time drivers for ride-hailing services can spend cruising streets in busy areas of Manhattan without passengers.

FILE PHOTO: Uber's logo is pictured at its office in Bogota, Colombia, December 12, 2019. REUTERS/Luisa Gonzalez

Judge Lyle Frank of the Supreme Court of State of New York in his decision called the city’s cruising cap “arbitrary and capricious.”

New York City passed the rule in August with the aim of reducing traffic congestion in Manhattan, where ride-share vehicles make up close to a third of peak traffic.

The city’s mayor’s office said it was reviewing its legal options, including an appeal.

“We put these rules in place to protect hardworking drivers and New Yorkers—and we’ll fight to keep them,” said a spokeswoman for the mayor.

Monday’s decision marks a win for Uber and Lyft in their largest U.S. market, where regulators have passed the toughest ride-hailing rules of the country and forced both companies to adjust their business models.

The ruling does not affect New York City’s other laws regarding ride-hailing, including a cap on the number of app-based, for-hire cars and minimum pay for the city’s 80,000 ride-share drivers.

Uber, which filed the lawsuit in September, welcomed the decision.

“Uber remains committed to fighting for driver flexibility in the face of politically motivated regulations and to stand up for policies that actually combat congestion,” the company said in a statement.

Lyft, which filed a separate lawsuit that Frank said was also covered by his Monday decision, said the ruling reaffirmed the regulator created bad policy.

“We look forward to working with state and city leaders to address New York City’s transportation challenges with the only true solution to congestion: comprehensive congestion pricing,” Lyft said in a statement.

To prepare for the laws, both Uber and Lyft over the past months locked out drivers from their apps at times and in areas of low demand.

The cruising cap, intended to come into effect in February 2020, set a limit on how much time drivers of app-based vehicles may drive or wait without passengers in Manhattan south of 96th Street. New York’s cruising rate was 41% in 2018. Under the new rule, the maximum would have fallen to 36% in February 2020 and 31% six months later.

Frank on Monday said the cruising rate should not include time a driver spends traveling to pick up passengers who requested a ride.