SANTA BARBARA, Calif. — This seaside city thought it had the perfect solution the last time California withered in a severe drought more than two decades ago: Tap the ocean to turn salty seawater to fresh water.

The $34 million desalination plant was fired up for only three months and mothballed after a miracle soaking of rain.

As the state again grapples with historic dryness, the city nicknamed the ‘‘American Riviera’’ has its eye on restarting the idled facility to hedge against current and future droughts.

Advertisement

‘‘We were so close to running out of water during the last drought. It was frightening,’’ said Joshua Haggmark, interim water resources manager. ‘‘Desalination wasn’t a crazy idea back then.’’

Removing salt from ocean water is not a far-out idea, but it’s no quick drought-relief option. It takes years of planning and overcoming red tape to launch a project.

Santa Barbara is uniquely positioned with a desalination plant in storage. But getting it humming again will not be as simple as flipping a switch.

After the plant was powered down in 1992, the city sold off parts to a Saudi Arabia company. The guts remain as a time capsule — a white elephant of sorts — walled off behind a gate near the Funk Zone, a corridor of art galleries, wineries, and eateries tucked between the Pacific and US 101.

The city estimates that it will need $20 million in technological upgrades, a cost likely to be borne by ratepayers. Any restart would require approval of city council, which will not vote until next spring after reviewing engineering plans and drought conditions.

Advertisement

Santa Barbara, population 89,000, has enough water for this year and even next year by buying supplemental supplies and as long as residents continue to conserve.

While it may seem like a head-scratcher to put the plant in hibernation soon after it was built, officials said the decision saved the city millions of dollars in unnecessary operating costs.

‘‘With the current drought likely to continue, they now appear as if they will be able to cash in on their insurance policy,’’ said Tom Pankratz, editor of Water Desalination Report and consultant on several other desalination projects in California.

The cyclical nature of droughts has made it difficult, if not impossible, to bet on desalination. It requires prime coastal real estate and the foresight to diversify the water supply in flush and dry times. Communities that choose desalination may be more resilient to inevitable droughts in the future.

Santa Barbara relies on water piped through tunnels from the Santa Ynez Mountains. But with Lake Cachuma, the main reservoir, dangerously low, the city expects desalination to play a role.

Advertisement

‘‘We live in a desert. We can expect droughts. It’s just inevitable that desalination is going to become a part of our regular water portfolio,’’ Haggmark said.

Santa Barbara is not alone in mulling desalination as parched conditions persist for a third straight year, forcing some rural places to ration water and farmers to fallow fields.

Earlier this year, the agency that delivers water to the central coast town of Cambria voted to approve an emergency desalination plant with the hopes of getting it running by July before water supplies dry up.

Instead of drawing ocean water, the proposed $5 million plant would pull brackish water from a well, treat it and reinject it into the aquifer. Since that would require a lengthy study, the plant probably won’t be able to go online until fall.

Not long ago, there was a rush to quench California’s growing thirst with seaside desalination plants. Currently, there are about a dozen proposed projects, according to the California Coastal Commission, which is charged with permitting the facilities.

The Western Hemisphere’s largest desalination plant is under construction north of San Diego after overcoming years of regulatory hurdles. The developer — Poseidon Resources LLC — is seeking approval to build another one in Huntington Beach, south of Los Angeles. Many environmentalists see desalination as a last resort, contending it’s an energy hog that sucks marine life into the plants.