SAN FRANCISCO — Uber made a big splash in its hometown on Wednesday when it started offering self-driving car service to passengers here, making San Francisco the second city in the world where the ride-hailing company provides autonomous vehicles for public use.

But California regulators made an even bigger splash late Wednesday when they told Uber to stop the service because it was illegal. The company, the officials said, did not have the necessary state permits for autonomous driving.

“It is illegal for the company to operate its self-driving vehicles on public roads until it receives an autonomous vehicle testing permit,” Brian G. Soublet, deputy director of California’s Department of Motor Vehicles, said in a letter to Uber. “Any action by Uber to continue the operation of vehicles equipped with autonomous technology on public streets in California must cease until Uber complies.”