The strongest earthquake in 20 years shook a large swath of Southern California and parts of Nevada on the July 4th holiday, rattling nerves and causing injuries and damage in a town near the epicenter, followed by a swarm of ongoing aftershocks.

The magnitude 6.4 struck Southern California near the city of Ridgecrest, about 175 kilometres northeast of Los Angeles, the US Geological Survey said on Thursday.

The Kern County Fire Department said on Twitter it was working “nearly 2 dozens incidents ranging from medical assistance to structure fires in and around the city of Ridgecrest, CA.”

The USGS said the quake, initially reported as a magnitude 6.6, was very shallow — only 8.7km — which would have amplified its effect.

There were no immediate reports of injuries or damage from the quake that struck around 1.30pm EDT in an area on the edge of Death Valley National Park.

US President Donald Trump said Thursday that the situation appeared to be under control amid reports of scattered damage.

“Been fully briefed on earthquake in Southern California. All seems to be very much under control!” Trump tweeted.

The temblor was felt throughout Los Angeles, as far north as Fresno and even in Las Vegas, Nevada, to the east. It was quickly followed by several smaller aftershocks in the area.

According to European quake agency EMSC, the quake was felt in an area inhabited by some 20 million people.

The epicentre was very close to Ridgecrest, a town with a population of more than 27,600 in the high desert. The area is associated with the Eastern California Shear Zone and has suffered earthquake swarms in the past, including a series of some 2,500 tremors over the course of five weeks in the summer of 1995.

USGS seismologist Lucy Jones said on CNN the area would be hit by many aftershocks in the coming days, and could even be hit by a larger quake.

Authorities in the Ridgecrest area could not be reached immediately for comment.

Thursday’s quake is the largest in Southern California since 1994 magnitude 6.6 Northridge earthquake, which was centered in a heavily populated area of Los Angeles and caused billions of dollars of damage.