London CNN Business  — 

Uber has won the right to continue operating in London, a crucial market for the company.

A UK judge on Monday overturned a decision by the local transportation regulator in November 2019 to strip Uber of its ride-hailing license because of safety concerns. Uber has now been granted a new license for 18 months.

Uber (UBER) “does not have a perfect record but it has been an improving picture,” Judge Tanweer Ikram said in his ruling. “I am satisfied that they are doing what a reasonable business in their sector could be expected to do, perhaps even more.”

London is one of the world’s most important cities for Uber. The US company said recently that 3.5 million Londoners regularly use its app and it claims 45,000 drivers in the capital. Uber shares were up 3% in early trading in New York.

Transport for London, the regulator, said in November 2019 that it had identified “a pattern of failures” that placed Uber passengers at risk. It said thousands of trips involved unauthorized drivers who were able to pass themselves off as other Uber drivers.

Uber has faced a lengthy battle in London. The city first refused to renew its license in 2017, citing several concerns including how Uber responded to serious crimes. Uber appealed that decision and was later granted permission to operate for 15 months.

A spokesperson for Transport for London said on Monday it would take “swift action” if the company failed to meet a number of conditions attached to the new 18-month license.

Uber faces increased competition in London, with ride-sharing rivals including Bolt, Ola, Kapten and ViaVan looking to take a bigger chunk of the market from Uber and the city’s traditional black cabs.

“Today’s decision is a disaster for London,” said Steve McNamara, general secretary of the Licensed Taxi Drivers’ Association, which represents black cab drivers.

“Uber has demonstrated time and time again that it simply can’t be trusted to put the safety of Londoners, its drivers and other road users above profit. Sadly, it seems that Uber is too big to regulate effectively, but too big to fail,” McNamara said in a statement.

Uber said in a statement that “there is nothing more important than the safety of the people” who use its app.

“This decision is a recognition of Uber’s commitment to safety and we will continue to work constructively with [Transport for London],” said Jamie Heywood, regional general manager for Northern and Eastern Europe.