LOS ANGELES - A quake with a magnitude as large as 7.1 jolted much of California, cracked buildings, set fires, broke roads and caused several injuries, authorities and residents said.

The quake - preceded by Thursday's 6.4-magnitude temblor in the Mojave Desert - was the largest Southern California temblor in at least 20 years and was followed by a series of large and small aftershocks.

It hit at 8:19 p.m. and was centred 11 miles from Ridgecrest in the same areas where the previous quake hit. But it was felt as far north as Sacramento, as far east as Las Vegas and as far south as Mexico.

Early magnitude estimates from the U.S. Geological Survey wavered between 6.9 and 7.1.

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

Megan Person, director of communications for the Kern County Fire Department, said there were reports of multiple injuries and multiple fires, but she didn't have details.

The county opened an emergency shelter. Meanwhile, a rockslide closed State Route 178 in Kern River Canyon, where photos from witnesses also showed that a stretch of roadway had sunk.

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

In downtown 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.”

Gov. Gavin Newsom activated the state Office of Emergency Services operations centre “to its highest level.”

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

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 that Friday's quake was on the same fault system as the earlier quake.

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

Firefighters around Southern California were mobilized to check for damage.

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

In Los Angeles, the quake rattled Dodger Stadium in the fourth inning of the team's game against the San Diego Padres.

The quake on Friday night happened when Dodgers second baseman Enrique Hernandez was batting. It didn't appear to affect him or Padres pitcher Eric Lauer.

“Everyone was jumping over us to leave,” said Daniel Earle, 52, of Playa del Rey, who was sitting with his wife in the stadium's reserve level.

“People were freaking out,” he said. “There was a concession guy, and he actually was really cool because he was really calm. He's like, 'Relax. Tranquilo. Relaxe. 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,” Earle said.

Six Flags Magic Mountain in Santa Clarita said in a tweet Friday night it had stopped running rides in the earthquake's wake.

“The safety of our guests and employees is our top priority and as a precautionary measure, we are conducting an extensive visual, structural, and operational safety checks on all of the rides before re-opening,” the park said on Twitter.

Disneyland had evacuated rides as the park conducted safety checks, the Hollywood Reporter wrote. The park's mobile app had marked all rides as “temporarily closed” on Friday night.

The quake came as communities in the Mojave Desert tallied damage and made emergency repairs to cracked roads and broken pipes from the earlier quake.

Hours earlier, seismologists had said that quake had been followed by more than 1,700 aftershocks and that they might continue for years.

Jones said aftershocks from the new main quake could occur for three years.

Earlier Friday, Los Angeles had revealed plans to lower slightly the threshold for public alerts from its earthquake early warning app. But officials said the change was in the works before the quake, which gave scientists at the California Institute of Technology's seismology lab 48 seconds of warning but did not trigger a public notification.

“Our goal is to alert people who might experience potentially damaging shaking, not just feel the shaking,” said Robert de Groot, a spokesman for the USGS's ShakeAlert system, which is being developed for California, Oregon and Washington.

The West Coast ShakeAlert system has provided non-public earthquake notifications on a daily basis to many test users, including emergency agencies, industries, transportation systems and schools.

Late last year, the city of Los Angeles released a mobile app intended to provide ShakeAlert warnings for users within Los Angeles County.

The trigger threshold for LA's app required a magnitude 5 or greater and an estimate of level 4 on the separate Modified Mercali Intensity scale, the level at which there is potentially damaging shaking.

Although Thursday's quake was well above magnitude 5, the expected shaking for the Los Angeles area was level 3, de Groot said.

A revision of the magnitude threshold down to 4.5 was already underway, but the shaking intensity level would remain at 4. The rationale is to avoid numerous ShakeAlerts for small earthquakes that do not affect people.

“If people get saturated with these messages, it's going to make people not care as much,” he said.

Construction of a network of seismic-monitoring stations for the West Coast is just over half complete, with most coverage in Southern California, San Francisco Bay Area and the Seattle-Tacoma area. Eventually, the system will send out alerts over the same system used for Amber Alerts to defined areas that are expected to be affected by a quake, de Groot said.

California is partnering with the federal government to build the statewide earthquake warning system, with the goal of turning it on by June 2021. The state has already spent at least $25 million building it, including installing hundreds of seismic stations throughout the state.

This year, Newsom said the state needed $16.3 million to finish the project, which included money for stations to monitor seismic activity, plus nearly $7 million for “outreach and education.” The state Legislature approved the funding last month, and Newsom signed it into law.

McCombs reported from Salt Lake City. Associated Press writers Adam Beam in Sacramento, Stefanie Dazio in Los Angeles and Tarek Hamada in Phoenix, Sports Writer Beth Harris in Los Angeles and Associated Press freelancer Jolene Latimer in Los Angeles contributed to this report.