An earthquake with a magnitude as large as 7.1 has jolted much of California, cracking buildings, igniting fires, breaking up roads and causing several injuries.

The quake — preceded by Thursday’s 6.4-magnitude tremor in the Mojave Desert — was the largest southern California earthquake in at least 20 years and was followed by a series of aftershocks.

It hit at 8.19pm local time on Friday (4.19am on Saturday in the UK) and was centred 11 miles from Ridgecrest in the same area where the previous quake hit.

Earthquake damageThe quake ignited several fires across California (Jessica Watson/PA)

But it was felt as far north as Sacramento, as far east as Las Vegas and as far south as Mexico.

The area in and around Ridgecrest, already trying to recover from the previous quake, took the brunt of damage.

Kern County Fire Chief David Witt said there had been no reports of building collapses or deaths, but a number of people were injured.

Earthquake damageThe quake cause a crack across the main road between Ridgecrest and Trona (James Quigg/The Daily Press/AP)

Meanwhile, a rockslide closed State Route 178 in Kern River Canyon, where photos from witnesses also showed that a stretch of the road had sunk.

San Bernardino County firefighters reported cracked buildings and one minor injury.

In central Los Angeles, 150 miles away, offices in skyscrapers rolled and rocked for at least 30 seconds.

Andrew Lippman, who lives in suburban South Pasadena, was sitting outside and reading the paper when Friday’s quake hit.

“It just started getting stronger and stronger, and I looked into my house and the lamp started to sway. I could see power lines swaying,” he said. “This one seemed 45 (seconds)… I’m still straightening pictures.”

Governor Gavin Newsom activated the state office of emergency services operations centre “to its highest level”.

He said: “The state is co-ordinating mutual aid to local first responders.”

Lucy Jones, a seismologist at the California Institute of Technology and a former science adviser at the Geological Survey, tweeted that Thursday’s earthquake was a “foreshock” and Friday’s quake was on the same fault system.

“You know we say we have a one in 20 chance that an earthquake will be followed by something bigger? This is that one in 20 time,” she tweeted.

Seismologists have warned that large aftershocks are expected to continue.

In LA, the quake rattled Dodger Stadium in the fourth inning of the team’s game against the San Diego Padres.

The quake happened when Dodgers second baseman Enrique Hernandez was batting. It did not appear to affect him or Padres pitcher Eric Lauer and the game continued.

But fans in the stadium were rattled.

Daniel Earle, 52, of Playa del Rey, who was sitting with his wife in the stadium’s reserve level, said: “Everyone was jumping over us to leave. People were freaking out.

“There was a concession guy, and he actually was really cool because he was really calm. He’s like, ‘Relax. Tranquilo. Relax. Tranquilo,’ and people were looking around.

“My wife was holding us, like squeezing. I’m surprised my arm is still here. She was squeezing into it so hard.”

An NBA Summer League game in Las Vegas was stopped after the quake. Speakers over the court at the Thomas & Mack Centre continued swaying more than 10 minutes after the tremor.

Disneyland in Orange County and Six Flags Magic Mountain in Santa Clarita closed their rides.