Ride-sharing firm Uber has been told to stop offering passengers self-driving cars in San Francisco, hours after it launched the service.

California regulators warned the company it had to stop immediately and get a state permit – or face legal action.

Uber had started giving passengers the option of a self-driving car, with a safety driver, when booking a journey.

The firm did not immediately respond to a request to comment.

Prior to the official order, a video of an Uber self-driving vehicle running a red light in San Francisco had been uploaded to YouTube.

Uber responded to this and another report of a similar incident in the city by blaming them on “human error” and adding it was investigating what happened.

“If Uber does not confirm immediately that it will stop its launch and seek a testing permit, [the Department of Motor Vehicles] will initiate legal action,” the California regulator wrote to the firm on Wednesday.

In a blog published on the same day, Anthony Levandowski – Uber’s head of advanced technology – referenced a “debate” over whether the company needed a permit to operate self-driving vehicles in the state.

“We don’t believe we do,” he wrote, adding that Uber’s vehicles all had on-board drivers who could take control when necessary.