The quake happened at about 21:10 local time on Friday (04:10 GMT on Saturday) and its epicentre was 1 mile (2km) east of the town of La Habra.
There were no immediate reports of significant damage or injuries.
A 4.4-magnitude quake was felt near Los Angeles earlier this month, rattling nerves but causing no major damage.
The latest earthquake was shallow at only 1.2 miles (2km) deep, according to the USGS.
It was felt across four counties, from Palm Springs in the east and Ventura County to the north, Reuters news agency reported.
The Los Angeles Fire Department said it was checking buildings and transport infrastructure for damage.
It said the quake was a reminder for people to be prepared.
The San Andreas fault, on the edge of the Pacific tectonic plate, runs directly through California, and the western US state has long braced for a devastating quake.
The 1994 Northridge quake, at 6.7 magnitude, left at least 60 people dead. A 6.9-magnitude quake in San Francisco five years earlier killed 67 people.
A magnitude 5.1 earthquake has struck the Los Angeles area of southern California, the US Geological Survey says.