A huge wildfire raging on the western boundary of Yosemite National Park was gaining strength on Saturday and led California's governor, Jerry Brown, to declare a state of emergency 150 miles away in San Francisco. Officials fear the blaze could threaten the city's water and power supply.

The week-long fire on the slopes of the western Sierra Nevada mountains is burning across nearly 200 sq miles, threatens 5,500 homes and could push deeper into Yosemite – one of the country's most treasured national parks as well as one of California's most popular tourist destinations.

Sprinklers were set up to protect two groves of giant sequoias, the park's symbol and among the largest and oldest living on earth. The so-called Rim fire is the fourth-largest in the US and one of 50 big blazes currently affecting the western states. But the speed at which it has grown – tripling in size over the past 24 hours – and the terrain over which it is travelling has made it hard to tackle, officials say. The fire has destroyed four homes and 12 outbuildings and was only 2% contained as of Friday. "It's just too doggone dangerous," said Lee Bentley of the forest service. "We could continue to see this fire burn very rapidly."

With more than 2,600 firefighters struggling to contain the blaze, Brown said the fire had caused damage to electrical infrastructure serving San Francisco's 2.6 million residents. The city receives 85% of its water from the Yosemite area. The blaze is less than four miles from the main reservoir, and two of the three hydroelectric power stations in the vicinity have been forced to shut down. The city has so far been able to buy power, but further disruptions or damage could have an effect, city officials said.

The fire has grown so large and is burning dry timber and brush with such ferocity that it has created its own weather pattern, making it difficult to predict in which direction it will move. Across the western states, the unusually early and intense fire season has prompted fire and land management agencies to open talks with Pentagon commanders and Canadian officials about bringing in reinforcements.

The US forest service reports that more than 31,900 fires have hit 3 million acres this year. While falling far short of records set in 2012 and 2006, when more than 9 million acres were burned in a year, climate change is being blamed for long stretches of drought and elevated temperatures. Last week, the service said it had spent nearly $1bn (£640m) on firefighting this year with only $50m remaining to control at least 40 fires burning in Idaho, Oregon, California, Utah, Nevada, Wyoming, Montana and other states.

In June, 19 members of a firefighting crew known as the Granite Mountain Hotshots died near Flagstaff, Arizona, after being forced into emergency shelters when winds shifted, cutting off their escape route.

Some experts say a decade-long drought in the western states, along with increased human settlement and activity in fire-prone regions, is behind the increasing severity and frequency of wildfires during the summer season.

Almost 87% of the western US is in a drought. Across the region, officials are taking extraordinary measures: Nevada is removing wild horses and stocks of cattle from federal lands; Wyoming is seeding clouds as part of a long-term "weather modification programme". Officials in Colorado say the state's south-eastern plains are experiencing dust-bowl conditions. All of New Mexico is officially in a drought, with ecologists warning of a permanent shift toward a desert ecology. The once-mighty Rio Grande is so dry it is being referred to as the "Rio Sand".

But with wildfires affecting major cities, California officials are calling for a new approach of controlled burns and mechanical clearing of brush – the so-called mosaic model – creating a patchwork of vegetation of different ages and densities that, if ignited, would burn less intensely. But fire managers say the mosaic model fails in the areas of dry, exposed chaparral and scrubland pervasive in southern California. Fires in those areas, they argue, burn hotter and more intensely than forest fires.

On Saturday evening, officials said they hoped a surge of tropical moisture would drench the region and ease conditions. But officials warned the rains may not reach the heart of the Rim fire. It continues to grow in several directions, said Daniel Berlant, a spokesman for the California Department of Forestry and Fire Protection: "Most of the fire activity is pushing to the east right into Yosemite."