The earthquake was just east-southeast of Berkeley, the survey said. It happened shortly before 3 a.m. PDT.
People posted online that they felt their homes shake.
“Our calls are coming in from San Francisco and the East Bay and all over,” KTVU-TV anchor Dave Clark said in a video from the newsroom. “Things were shaking in our newsroom. ... It caught everyone off guard.”
It wasn't immediately known if there were any injuries or significant damage.
(This is a developing story)