The quake happened at about 21:10 local time on Friday and its epicentre was 1 mile 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 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.
S2B2R5kY8KMImage source: Wikimedia Commons President-elect Donald Trump celebrated his election victory at the Ultimate Fighting…
Millions of voters across the US chose to return Donald Trump to the White House…
Donald Trump declares victory in the US election as he addresses jubilant supporters in Florida.…
Stocks around the world are rising as Donald Trump appears to be on the cusp…
Donald Trump has won Pennsylvania, North Carolina and Georgia and taken a lead over Kamala…
Quincy Jones, the celebrated musician and producer who worked with Michael Jackson, Frank Sinatra, Ray…