The quake was centered about 14 miles north-northwest of Borrego Springs and hit just after 1 a.m., according to the U.S. Geological Survey.
Residents reported feeling shaking from the earthquake in San Diego, West Los Angeles, Riverside and Woodland Hills.
There were no immediate reports of injuries or damage, San Diego Sheriff's Lt. Andrea Arreola said.
"At this point, we are just monitoring" the area, she said.
Hemet police said the earthquake set off a lot of alarms at businesses.
The earthquake occurred along the San Jacinto Fault, historically the most active fault in Southern California, according to seismologist Lucy Jones.
Within an hour, there were six aftershocks in the same general area, the strongest a magnitude-3.5 shaker at 1:06 a.m. with roughly the same epicenter but at a depth of 6.7 miles.