The quake struck Tuesday afternoon 9 miles (14 kilometers) south of Brentwood, California.
People took to social media to say they felt a sharp jolt in the area east of San Francisco. There were thousands of reports of people feeling it on the U.S. Geological Survey website.
The quake was followed minutes later by a magnitude 3.5 aftershock.
It comes less than two weeks after a pair of powerful earthquakes rocked a remote desert area in Southern California, damaging homes, buckling roads and rupturing gas lines.
Thousands of aftershocks have followed the magnitude 6.4 earthquake on July 4 and the 7.1 quake the next day.
Copyright 2019 The Associated Press. All rights reserved. This material may not be published, broadcast, rewritten or redistributed.