Ride-hailing company Uber has won a protracted legal battle in London that allows it to continue operating. On Monday, a judge overturned a proposed ban on the company's ride-hailing app by the city's transport regulator and granted it a new 18-month license.

The Transport for London initially revoked Uber's license for a second time last year because the company had shown a "pattern of failures" that had placed customers at risk. Uber's license was first revoked in 2017.

According to its initial filing against Uber, Transport for London claimed "glitches" in the company's app had allowed unauthorized drivers to upload photos onto other drivers' accounts. This resulted in an estimated 14,000 unauthorized trips - which Transport for London said placed passengers at risk.

Judge Tan Ikram at the Westminster Magistrates' Court on Monday said he was confident Uber no longer posed a risk to public safety. Uber must meet several conditions for its 18-month license. There have been previously agreed.

"Despite their historical failings, I find (Uber), now, to be a fit and proper person to hold a London private hire vehicle operator's license," Ikram said in his decision.

Following the decision Uber's share price rose as much as 6% in premarket trading. The company's stock eventually ended up 3% higher Monday.

Uber's regional general manager for Northern and Eastern Europe Jamie Heywood said in a statement the decision is further recognition of the company's commitment to ensuring the safety of its drivers and passengers. He said the decision allowed the company to continue working to "keep London moving."

London remains Uber's largest market in Europe. Since launching in 2012 the company has had more than 3.5 million users and 45,000 drivers in the capital.

It introduced measures to address Transport for London's safety concerns. These included a new system in April that verified the identity of drivers using a combination of advanced facial recognition technologies and actual human reviewers.