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.

The two parchment books dating from 1727 record the setting up of Burwash Charity School with a legacy of Â£100 from the Rev George Barnsley.
Other subscribers were Thomas and Henry Pelham and local landowners and businessmen.
The books, which have been in the hands of a local historian, are now being held at The Keep in Brighton.
They cover 150 years up to 1877, recording some of the pupils' names, the teachers and the school accounts.
Two of the first three teachers employed in 1727 were unable to write, and when asked to sign receipts for their wages, could only sign with a line or cross.
"They probably weren't trained at all," said senior archivist Christopher Whittick.
"This was a charity school for poor children."
He said the books would be of interest to many different people.
"If you are interested in education that's the most obvious but if you are interested in Burwash, or the families of Burwash, or if your ancestor was one of the children there is something there for you."
The Keep at Falmer, which opened in 2013, holds the historical records of East Sussex Record Office, Brighton Royal Pavilion and Museums and the University of Sussex.
A magnitude 5.1 earthquake has struck the Los Angeles area of southern California, the US Geological Survey says.
[NEXT_CONCEPT]
Documents thought to be the earliest school records in Sussex have been deposited in county archives.