In front of a fire station in Palm Springs, Calif., residents crowded around a pit of sand on Saturday afternoon under gray clouds, using shovels to fill bag after bag. Every 15 minutes or so, a tractor would dump more sand in the pit.

“I’m exhausted,” said Greg Tormo, a real estate agent, who had just finished filling 10 sandbags and was taking a break after carrying most of them to his car. “I’m gathering the energy to take the last three.”

Although Mr. Tormo was grateful for his sandbags, he was worried about how effective they would be in protecting his home from flooding.

“I think everyone is trying to do the right thing to prepare, but no one really knows what the right thing is,” he said.

Residents throughout Palm Springs were just as anxious as they girded for Hurricane Hilary, which was racing northward on Saturday toward Mexico and the American Southwest and threatening potentially devastating impacts. The region was placed under its first-ever tropical storm warning — meaning wind speeds were expected to be between 39 and 73 miles per hour — and forecasters said the storm would bring heavy rains that could cause massive flooding, mudslides and power outages.

Flood watches and flash flood warnings were in effect on Saturday for several areas of southwest California, including the Coachella Valley, which contains Palm Springs. And Los Angeles County officials advised all residents to evacuate Catalina Island, which is home to more than 4,000 people.

On Saturday, Gov. Gavin Newsom declared a state of emergency for Southern California and some Central Valley counties. The state also closed state beaches in San Diego and Orange Counties, as well as 10 state parks.

At a news conference, Nancy Ward, the director of the California Governor’s Office of Emergency Services, said the state “is threatened by what could be one of the most devastating storms that we’ve had hit California in more than a decade.”

A sunny, vibrant oasis nestled in the Coachella Valley desert just two hours east of Los Angeles, Palm Springs is known as an upscale resort city. Settled by Native Americans some 8,000 years ago who found paradise in its many springs, it became famous as a Hollywood getaway for the stars.

For the city’s 45,000 residents, the heat can be sweltering — the temperature reached 123 degrees in 2021 — but its distinct skyline of tall palm trees makes for a picturesque companion to the San Jacinto, Santa Rosa and San Bernardino mountain ranges.

It is these mountains, however, that make the city particularly vulnerable to Hurricane Hilary this weekend, as torrents of water washing down could overwhelm the rivers and tributaries below, creating potentially life-threatening flooding.

“This entire valley is basically a giant river bottom,” said Carley Pinkney, a Palm Springs resident who has lived in the Coachella Valley for more than 30 years.

Forecasters say the region could receive up to 10 inches of rain, as much as that area would typically log in an entire year.

“Usually, when the weatherman says rain, they’re wrong because we get rain like one and a half days a year,” said Michael Matera, who was wiping his brow after shoveling sand at the fire station.

He added: “When it rains, it just sits there, like it’s in a bowl.”

In the Coachella Valley, homeless residents are particularly vulnerable because many of them camp near riverbanks, dry creek beds and empty canals, areas that are historically dry this time of year. The Coachella Valley Rescue Mission has deployed an outreach team to travel to those locations and encourage people to come to a shelter.

Thomas Shoots, a fire captain and public information officer for Cal Fire of Riverside County, said that the more populated areas of the city offer different challenges, but that “as we move out to our desert region, there’s less of a population but a lot more concern about the potential for that heavy rain to really cause some flooding issues.”

Elsewhere in the area, residents were stocking up and preparing to hunker down. At a Ralph’s supermarket, part of a Southern California grocery chain, Ellie Larson loaded her trunk with water and wine. “The essentials,” she said.

She added that she was mostly helping out friends and neighbors who were not around to care for their second homes. This is a time of year when many people leave the city, opting to escape the hot summers, so many people are looking out for their neighbors’ houses.

That same spirit could be found at one apartment complex across town, where tenants prepared for the storm by placing sandbags and cleaning out storm drains. Everyone seemed cautious but relaxed, making sure their neighbors had what they needed.

“People are a little panicky,” said Cyndee Bromley, who has lived in Palm Springs full time since 2004. But after everyone finished working, she added, “they said we’re going to have a hurricane party.”

Back at the fire station, though, Carl Armstrong, who has lived in Palm Springs since 1989, was in an altogether different state of mind. As he collected sandbags, he summed up his feelings about the coming storm in one word: “Bewildered.”