Shaken residents were cleaning up Sunday from two of the biggest earthquakes to rattle California in decades as scientists warn that both should serve as a wake-up call to be ready when the long-dreaded “Big One” strikes.

California is spending more than $ 16 million US to install thousands of quake-detecting sensors statewide that officials say will give utilities and trains precious seconds to shut down before the shaking starts.

Gov. Gavin Newsom said it’s time residents did their part by mapping out emergency escape routes and preparing earthquake kits with food, water, lights and other necessities.

“It is a wake-up call for the rest of the state and other parts of the nation, frankly,” Newsom said at a Saturday news conference on efforts to help a desert region jolted by back-to-back quakes.

A magnitude 6.4 earthquake Thursday and a magnitude 7.1 quake Friday were centred 18 kilometres from the small desert town of Ridgecrest, Calif., about 241 kilometres from Los Angeles.

The quakes buckled highways and ruptured gas lines that sparked several house fires, and officials said about 50 homes in the nearby small town of Trona, Calif., were damaged. No one was killed or seriously injured, which authorities attributed to the remote location in the Mojave Desert.

Friday’s magnitude 7.1 earthquake was centred 18 kilometres from the small desert town of Ridgecrest, Calif., about 241 kilometres from Los Angeles. (CBC)

“Any time that we can go through a seven-point earthquake and we do not report a fatality, a major injury, do not suffer structure damage that was significant, I want to say that that was a blessing and a miracle,” Kern County Fire Department spokesman Andrew Freeborn said Sunday.

Seismologists said a similar-sized quake in a major city like San Francisco, Los Angeles or San Diego could collapse bridges, buildings and freeways, as well as spark devastating fires fuelled by ruptured gas lines.

“We’re going to have a magnitude 6, on average, somewhere in Southern California every few years. We’ve actually gone 20 years without one, so we have had the quietest 20 years in the history of Southern California,” said seismologist Lucy Jones of the California Institute of Technology.

“That’s unlikely to continue on the long run,” she added. “Geology keeps on moving … and we should be expecting a higher rate. And when it happens near people, it is going to be a lot worse.”

Towns recovering

As people prepared, authorities in rural Kern County repaired roads and utilities.

The quakes sparked several house fires, shut off power, snapped gas lines, cracked buildings and flooded some homes when water lines broke. Newsom estimated the damage at more than $ 100 million US and said President Donald Trump called him to offer federal support.

All roads serving Ridgecrest — a town of 28,000 residents — were safe to drive again Sunday, water and power had been restored and bus service would resume Monday, police chief Jed McLaughlin said. He said homes were being inspected for damage and that all government buildings were declared safe.

A house in Trona, Calif., was damaged after a 7.1 magnitude earthquake struck in the area on Friday. It was the second large earthquake to hit the area in two days and the largest in Southern California in 20 years. (Mario Tama/Getty Images)

Residents of the nearby town of Trona, southwest of Death Valley, reported electricity had been restored but water and gas service was still out at many homes. People in the town of about 2,000 lined up for free water that California National Guard soldiers handed out at Trona High School.

“I just picked up a couple cases for me and my dog,” said Jeb Haleman, adding that his home of 40 years otherwise escaped unscathed.

When Friday’s quake struck he said he was about 10 stories off the ground working on a boiler at the Searles Valley Minerals plant.

“I was holding on for dear life,” he said, laughing. “That was quite a ride.”

With temperatures hovering around 100 F (38 C), Sgt. Robert Madrigal said the National Guard would provide water “just as long as they need us here.”

Local resident Steve Latham surveys the effects of the magnitude 7.1 earthquake along California State Route 178 between Ridgecrest and Trona. (Robyn Beck/AFP/Getty Images)

Officials were taking precautions because of the heat and expectation of thousands of smaller aftershocks over the next several days.

The U.S. Geological Survey said there was just a one per cent chance of another magnitude seven or higher earthquake in the next week, and a rising possibility of no magnitude six quakes.

The National Guard was sending 200 troops, logistical support and aircraft, Maj. Gen. David Baldwin said.

The California Office of Emergency Services brought in cots, water and meals and set up cooling centres in the region, Director Mark Ghilarducci said.