The "Rim Fire" has scorched 252 square miles, and is burning near the Hetch Hetchy Reservoir. The blaze, which erupted Aug. 17, is now 20 percent contained. Hundreds of firefighters were digging trenches, clearing brush and starting back blazes.
Fire officials say the fire is burning with such force that it created its own weather pattern, which makes it hard for crews to predict which direction it will move.
Strong winds threatened to push the blaze closer to Tuolumne City and nearby communities. Flames also continue to burn in the remote wilderness area of Yosemite and is edging closer to the Hetch Hetchy Reservoir, the source of San Francisco's famously pure drinking water.
Despite ash falling like snowflakes on the reservoir and a thick haze of smoke limiting visibility to 100 feet, the quality of the water piped to the city 150 miles away is still good, according to officials with the San Francisco Public Utilities Commission.
Utility officials monitored the clarity of the Hetch Hetchy Reservoir and used a massive new $4.6 billion gravity-operated pipeline system to move water quickly to reservoirs closer to the big city. The Hetch Hetchy supplies water to 2.6 million people in the San Francisco Bay area, 150 miles away.
The threat prompted Gov. Jerry Brown to declare a state of emergency for San Francisco.
The fire is threatening about 4,500 homes. Twenty-three structures have been destroyed and two firefighters suffered minor injuries. The cause of the fire remains under investigation.
Gov. Brown visited Tuolumne City to meet firefighters on Monday. So far, the Rim Fire has cost California more than $20 million. It's quickly moving toward the top 10 largest fires in the state.
"This is August. What is going to happen in September in terms of fires? We don't know, but I'm sure they're going to cost us money, and the state of California has that money because we've cut," said Brown.
The Associated Press contributed to this report.