The quake struck at 10.44am local time west of Ferndale, a small city in coastal Humboldt County near the Oregon border, according to the US Geological Survey.
It was felt as far south as San Francisco, where residents felt a rolling motion for several seconds.
It was followed by smaller aftershocks.
The San Francisco Bay Area Rapid Transit District, known as BART, has stopped traffic in all directions through the underwater tunnel between San Francisco and Oakland.
At least 5.3 million people in California were under a tsunami warning after the magnitude 7.0 earthquake, the U.S. Geological Survey said in a yellow alert, which predicts localized but minimal damage.
More than 1.3 million people lived close enough to the quake that they could have felt it, the USGS estimated.
In the Santa Cruz area, phones buzzed with a tsunami warning from the National Weather Service.
“A series of powerful waves and strong currents may impact coasts near you. You are in danger,” the warning said.
“Get away from coastal waters. Move to high ground or inland now. Keep away from the coast until local officials say it is safe to return.”
The San Francisco Zoo’s visitors have been evacuated as a result of the earthquake, the zoo said in a post on the social media platform X.
The animals have been secured and staff has been moved to higher ground.