A videographer records the Rim Fire burning through trees near Yosemite National Park, Calif., on Tuesday, Aug. 27, 2013. Firefighters gained some ground Tuesday against the huge wildfire burning forest lands in the western Sierra Nevada, including parts of Yosemite National Park.

Photo: Jae C. Hong, Associated Press

A videographer records the Rim Fire burning through trees near...

Image 2 of 34

Fire trucks drive through heavy smoke generated by the Rim Fire near Yosemite National Park, Calif., on Tuesday, Aug. 27, 2013. Firefighters gained some ground Tuesday against the huge wildfire burning forest lands in the western Sierra Nevada, including parts of Yosemite National Park. (AP Photo/Jae C. Hong)

Photo: Jae C. Hong, Associated Press

Fire trucks drive through heavy smoke generated by the Rim Fire...

Image 3 of 34

The Rim Fire burns through trees near Yosemite National Park, Calif., on Tuesday, Aug. 27, 2013. Firefighters gained some ground Tuesday against the huge wildfire burning forest lands in the western Sierra Nevada, including parts of Yosemite National Park. (AP Photo/Jae C. Hong)

Photo: Jae C. Hong, Associated Press

The Rim Fire burns through trees near Yosemite National Park,...

Image 4 of 34

A firefighter atop a truck surveys the smoldering ruins of the venerable Tuolumne Camp, run by the city of Berkeley.

Photo: Don Bartletti, McClatchy-Tribune News Service

A firefighter atop a truck surveys the smoldering ruins of the...

Image 5 of 34

Sgt. Chris Boni, crew chief from the 1-140th Aviation Battalion, releases water from a UH-60 Black Hawk helicopter in the struggle to bring the devastating Rim Fire under control.

Photo: Master Sgt. Julie Avey, Associated Press

Sgt. Chris Boni, crew chief from the 1-140th Aviation Battalion,...

Image 6 of 34

A fire truck drives past burning trees as firefighters continue to battle the Rim Fire near Yosemite National Park, Calif., on Monday, Aug. 26, 2013. Crews working to contain one of California's largest-ever wildfires gained some ground Monday against the flames threatening San Francisco's water supply, several towns near Yosemite National Park and historic giant sequoias. (AP Photo/Jae C. Hong)

Photo: Jae C. Hong, Associated Press

A fire truck drives past burning trees as firefighters continue to...

Image 7 of 34

Sacramento River Fire District Capt. Jerry Winters rests at base camp before the night shift fighting the Rim Fire in the Stanislaus National Forest. The blaze, which erupted Aug. 17 on the western edge of Yosemite, has grown to more than 250 square miles and destroyed 23 structures.

Photo: Paul Kitagaki Jr., Associated Press

Sacramento River Fire District Capt. Jerry Winters rests at base...

Image 8 of 34

The Rim Fire burns along Highway 120 near Yosemite National Park, Calif., on Sunday, Aug. 25, 2013. With winds gusting and flames jumping from treetop to treetop, hundreds of firefighters have been deployed to protect communities in the path of the Rim Fire raging north of Yosemite National Park. (AP Photo/Jae C. Hong)

Photo: Jae C. Hong, Associated Press

The Rim Fire burns along Highway 120 near Yosemite National Park,...

Image 9 of 34

This photo obtained August 26, 2013 courtesy of the US Forest Service, shows NPS crews as they dig hand line along a sprinkler hose as part of a multi-pronged approach to protecting the Giant Sequoias against the Rim fire. A wildfire raging on the northern tip of California's Yosemite National Park threatens a world-famous site of natural beauty and the reservoir that provides San Francisco with drinking water. AFP PHOTO / US FOREST SERVICE == RESTRICTED TO EDITORIAL USE / MANDATORY CREDIT: "AFP PHOTO / US FOREST SERVICE / NO MARKETING / NO ADVERTISING CAMPAIGNS / DISTRIBUTED AS A SERVICE TO CLIENTS ==HO/AFP/Getty Images

Photo: Ho, AFP/Getty Images

This photo obtained August 26, 2013 courtesy of the US Forest...

Image 10 of 34

Two firefighters watch trees burn while battling the huge blaze, which was reported 15 percent contained as of Monday afternoon.

Photo: Jae C. Hong, Associated Press

Two firefighters watch trees burn while battling the huge blaze,...

Image 11 of 34

Smoke clouds and bands of haze from the Rim Fire in the western Sierra Nevada loom up some 20 miles behind the famed granite monolith known as Half Dome, right center, seen from 11,500-foot Mt. Clark in Yosemite Valley in Yosemite National Park, Calif., Saturday, Aug. 24, 2013. Crews working to contain one of California's largest-ever wildfires gained some ground Monday against the flames threatening San Francisco's water supply, several towns near Yosemite National Park and historic giant sequoias. Containment of the Rim Fire more than doubled to 15 percent, although it was within a mile of the park's Hetch Hetchy Reservoir, the source of San Francisco's famously pure drinking water, officials said Monday. (AP Photo/Tami Abdollah)

Photo: Tami Abdollah, Associated Press

Smoke clouds and bands of haze from the Rim Fire in the western...

Image 12 of 34

NASA's Terra satellite provided a natural-color image of the drought-fueled Rim Fire at Yosemite's western edge.

Photo: Nasa, McClatchy-Tribune News Service

NASA's Terra satellite provided a natural-color image of the...

Image 13 of 34

Smoke clouds from the Rim Fire in the western Sierra Nevada loom up some 20 miles behind the famed granite monolith known as Half Dome, left center, in Yosemite Valley in Yosemite National Park, Calif., Saturday, Aug. 24, 2013. Crews working to contain one of California's largest-ever wildfires gained some ground Monday against the flames threatening San Francisco's water supply, several towns near Yosemite National Park and historic giant sequoias. Containment of the Rim Fire more than doubled to 15 percent, although it was within a mile of the park's Hetch Hetchy Reservoir, the source of San Francisco's famously pure drinking water, officials said Monday. (AP Photo/Tami Abdollah)

Photo: Tami Abdollah, Associated Press

Smoke clouds from the Rim Fire in the western Sierra Nevada loom up...

Image 14 of 34

A burned-out SUV sits within the swath of destruction wrought by the Rim Fire, which had burned 235 square miles by Monday.

Photo: Jae C. Hong, Associated Press

A burned-out SUV sits within the swath of destruction wrought by...

Image 15 of 34

A firefighter looks at the Rim Fire incident report map posted at the command post near Yosemite National Park, Calif., on Monday, Aug. 26, 2013. Crews working to contain one of California's largest-ever wildfires gained some ground Monday against the flames threatening San Francisco's water supply, several towns near Yosemite National Park and historic giant sequoias. (AP Photo/Jae C. Hong)

Photo: Jae C. Hong, Associated Press

A firefighter looks at the Rim Fire incident report map posted at...

Image 16 of 34

In this Sunday, Aug. 25, 2013, photo, the Hetch Hetchy Reservoir is hazy with smoke from the Rim Fire fills the air in Yosemite National Park, Calif. Crews working to contain one of California's largest-ever wildfires gained some ground Monday against the flames threatening San Francisco's water supply, several towns near Yosemite National Park and historic giant sequoias. (AP Photo/Jae C. Hong)

Firefighters wake up at the crack of dawn in a tent camp at the Rim fire base camp near Groveland, California, Monday, August 26, 2013. (Don Bartletti/Los Angeles Times/MCT)

Photo: Don Bartletti, McClatchy-Tribune News Service

Firefighters wake up at the crack of dawn in a tent camp at the Rim...

Image 19 of 34

GROVELAND, CA - AUGUST 25: Flames billow from the front of a car that was consumed by the Rim Fire on August 25, 2013 near Groveland, California. The Rim Fire continues to burn out of control and threatens 4,500 homes outside of Yosemite National Park. Over 2,000 firefighters are battling the blaze that has entered a section of Yosemite National Park and is currently 7 percent contained. (Photo by Justin Sullivan/Getty Images)

Photo: Justin Sullivan, Getty Images

GROVELAND, CA - AUGUST 25: Flames billow from the front of a car...

Image 20 of 34

A firefighter watches for spot fires during a burnout operation while battling the Rim Fire near Yosemite National Park, Calif., on Sunday, Aug. 25, 2013. Fire crews are clearing brush and setting sprinklers to protect two groves of giant sequoias as a massive week-old wildfire rages along the remote northwest edge of Yosemite National Park. (AP Photo/Jae C. Hong)

Photo: Jae C. Hong, Associated Press

A firefighter watches for spot fires during a burnout operation...

Image 21 of 34

GROVELAND, CA - AUGUST 24: Cows walk through a section of forest that was burned by the Rim Fire outside of Camp Mather on August 24, 2013 near Groveland, California. The Rim Fire continues to burn out of control and threatens 4,500 homes outside of Yosemite National Park. Over 2,000 firefighters are battling the blaze that has entered a section of Yosemite National Park and is currently 5 percent contained. (Photo by Justin Sullivan/Getty Images)

Photo: Justin Sullivan, Getty Images

GROVELAND, CA - AUGUST 24: Cows walk through a section of forest...

Image 22 of 34

GROVELAND, CA - AUGUST 25: U.S. Fish and Wildlife Service firefighter Corey Adams sits on a tree stump as he monitors the Rim Fire on August 25, 2013 near Groveland, California. The Rim Fire continues to burn out of control and threatens 4,500 homes outside of Yosemite National Park. Over 2,000 firefighters are battling the blaze that has entered a section of Yosemite National Park and is currently 7 percent contained. (Photo by Justin Sullivan/Getty Images)

Photo: Justin Sullivan, Getty Images

GROVELAND, CA - AUGUST 25: U.S. Fish and Wildlife Service...

Image 23 of 34

YOSEMITE NATIONAL PARK, CA - AUGUST 24: Smoke from the Rim Fire lingers over the O'Shaughnessy Dam at Hetch Hetchy Reservoir on August 24, 2013 in Yosemite National Park, California. The Rim Fire continues to burn out of control and threatens 4,500 homes outside of Yosemite National Park. Over 2,000 firefighters are battling the blaze that has entered a section of Yosemite National Park and has prompted California Gov. Jerry Brown to declare a state of emergency for San Francisco due to damage to some of the lines and stations that move power to San Francisco. The Hetch Hetchy reservoir also had to take two of its three hydroelectric power stations out of service. (Photo by Justin Sullivan/Getty Images)

A firefighter atop a fire truck surveys the ruins of Berkeley Tuolumne Camp, burned by the Rim Fire outside Yosemite.

Photo: Jae C. Hong, Associated Press

A firefighter atop a fire truck surveys the ruins of Berkeley...

Image 26 of 34

Image 27 of 34

Angel City fire fighters Cody Stephens, left, and Kevin Brown, center, wait as helicopter dumps water on hot spots battling the Rim Fire in the Stanislaus National Forest along Highway 120 near Yosemite National Park, Monday, Aug. 26, 2013 in, Calif. With winds gusting to 25mph on Sierra, hundreds of firefighters have been deployed to protect this and other communities in the path of the Rim Fire raging north of Yosemite National Park. (AP Photo/The Sacramento Bee, Paul Kitagaki Jr.)

Photo: Paul Kitagaki Jr., Associated Press

Angel City fire fighters Cody Stephens, left, and Kevin Brown,...

Image 28 of 34

A helicopter dumps water on hot spots battling the Rim Fire in the Stanislaus National Forest along Highway 120 near Yosemite National Park, Monday, Aug. 26, 2013 in, Calif. With winds gusting to 25mph on Sierra, hundreds of firefighters have been deployed to protect this and other communities in the path of the Rim Fire raging north of Yosemite National Park. (AP Photo/The Sacramento Bee, Paul Kitagaki Jr.)

Photo: Paul Kitagaki Jr., Associated Press

A helicopter dumps water on hot spots battling the Rim Fire in the...

Image 29 of 34

Paint peels after the sign was burned from the Rim Fire in the Stanislaus National Forest along Highway 120 near Yosemite National Park, Monday, Aug. 26, 2013 in, Calif. With winds gusting to 25mph on Sierra, hundreds of firefighters have been deployed to protect this and other communities in the path of the Rim Fire raging north of Yosemite National Park. (AP Photo/The Sacramento Bee, Paul Kitagaki Jr.)

Photo: Paul Kitagaki Jr., Associated Press

Paint peels after the sign was burned from the Rim Fire in the...

Image 30 of 34

Mira Gottlieb during a Tuolumne Camp Memorial Gathering in Berkley at Civic Center Park on August 26th 2013. Tuolumne Family Camp was lost to the Rim Fire near Yosemite National Park.

Photo: Sam Wolson, Special To The Chronicle

Mira Gottlieb during a Tuolumne Camp Memorial Gathering in Berkley...

Image 31 of 34

Juliet Meblin and her father Andrew Meblin during a Tuolumne Camp Memorial Gathering in Berkley at Civic Center Park on August 26th 2013. Tuolumne Family Camp was lost to the Rim Fire near Yosemite National Park.

Photo: Sam Wolson, Special To The Chronicle

Juliet Meblin and her father Andrew Meblin during a Tuolumne Camp...

Image 32 of 34

Tuolumne Camp Memorial Gathering in Berkley at Civic Center Park on August 26th 2013. Tuolumne Family Camp was lost to the Rim Fire near Yosemite National Park.

Firefighters douse hot spots amid the smoldering ruins of the Berkeley Tuolumne Camp near Groveland, California, Monday, August 26, 2013. The 1922 village of cabins and a large dining hall on the Tuolumne River that once served 4000 people annually was almost totally destroyed by the massive, uncontrolled Rim Fire. All guests had been evacuated. (Don Bartletti/Los Angeles Times/MCT)

Firefighters battled fierce winds Monday as the raging fire near Yosemite National Park pushed forward on two fronts, threatening the Hetch Hetchy Reservoir and at least three local towns.

The giant Rim Fire moved northwest and southeast toward the communities of Tuolumne, Twain Harte and Ponderosa Hills, where hundreds of firefighters made a determined stand, hoping to halt the spread of what is now the 13th-largest fire in California history.

More than 3,700 firefighters, who rushed in from all over the country, managed to slow the advance of the blaze, which had grown to more than 250 square miles on the western edge of Yosemite. But thousands of homes, many in the hills above the Gold Rush-era city of Sonora, remained threatened.

Gov. Jerry Brown visited the area Monday, pledging to commit the money and personnel needed to control the blaze.

"We have to spend what it takes," Brown said, just days after declaring a state of emergency that will help draw federal resources to the firefighting effort. On Monday, federal disaster officials offered to pay up to 75 percent of the cost.

Only stumps remain

The cause of the fire, which erupted Aug. 17 in a remote section of the Stanislaus National Forest, is not known. Twenty-three structures have been destroyed, and two people have been injured, fire officials said.

One of the biggest casualties so far is the city of Berkeley's popular 15-acre Tuolumne Camp, which was a smoking ruin Monday, its rustic cabins burned to cinders. The once-picturesque camp on the south fork of the Tuolumne River, where as many as 3,500 campers a year have visited since 1922, was a jumble of charred wood, ash and blackened bedsprings amid crumpled corrugated tin roofs.

The swimming hole was surrounded by blackened stumps and smoldering wreckage, and the beach was littered with deflated rafts, children's flip-flops, lifeguard vests and other vacation detritus, as if the campers had dropped everything and made a mad dash to escape the approaching fire.

Generations of campers who had attended the city-run camp were mourning its devastation.

"Having a place where time stands still is really important, and I loved that about that place," said Sarah Miller, an Oakland resident who has visited the camp with her husband and two daughters for most of the past eight years.

Now she's wondering if she'll be able to return.

Movement slows

Berkeley officials said historical items, such as photographs and wall hangings, were removed last week when the campers were evacuated.

San Francisco officials said Monday that the city-owned Camp Mather, which has been a retreat for San Francisco families for decades, has so far been spared by flames, though the fire continues to burn in the area.

The Rim Fire is spreading more slowly than it was last week. Late Monday, state fire officials reported that the blaze was 20 percent contained - more than double the figure from a day earlier. Still, the dry landscape, steep terrain and high temperatures were complicating the fight.

"It's still spreading in all directions except" in the small portion of the perimeter where a fire line has been built, said Michael Williams, spokesman for the Rim Fire incident command team. On Sunday, "they made very good progress on it, but it still burned 15,720 acres."

Dick Fleishman, a U.S. Forest Service spokesman speaking on behalf of agencies battling the fire, said crews were making a stand near Tuolumne, where high winds were putting communities in danger. Firefighters used bulldozers to cut firebreaks near what locals call Duckwall Mountain, the last obstacle preventing the flames from rushing into Tuolumne and Twain Harte. Planes and helicopters dropped retardant and water on the leading edge of the inferno.

"We have a lot of folks up there trying to pinch that thing off," Fleishman said. "We're making a lot of progress in the northwest area."

An evacuation advisory is in place for parts of Tuolumne, Twain Harte and Ponderosa Pines, Fleishman said.

Out of harm's way

Those who had already left told of the advancing flames and unbearable smoke.

"I have lived here for 30 years, and I have never seen a fire spread that fast," said Shelly Davis-King, 64, who evacuated with her husband, John Lytle, from their home in Tuolumne, where the couple watched as the fire marched toward their home. She has been volunteering with the Lions Club and Red Cross since Thursday.

Bob Milligan, 66, and his wife, Debbie Stirman, 62, said the smoke got so bad that they had to leave their Twain Harte home. The couple, who are dealing with respiratory and heart problems, have been staying since Saturday at the Red Cross shelter at the Tuolumne County fairgrounds in Sonora.

"Every morning we would wake up and the fire would be bigger," said Stirman. "It was very worrisome. The smoke was getting worse and worse, and then the ash started to fall. That's when we decided we had to get out."

More than 1,000 meals have been served at the Red Cross shelter, including meals for 91 evacuees who stayed there Sunday, according to Tom Penhallegon, the meals coordinator for the Sonora Lions Club.

Meanwhile, the threat of fire lessened in the Groveland area, a tourist hub on Highway 120. Evacuation orders were lifted in the communities of Pine Mountain Lake and Buck Meadows over the weekend, but fire officials said 4,500 structures were still considered under threat.

Licking at Yosemite

Flames continued to burn the western flanks of Yosemite near Lake Eleanor. The fire was burning on both sides of Highway 120 on Monday, as the prevailing winds pushed the edge ever closer to Hetch Hetchy.

The park's Highway 120 entrance remains shut down, and some lower-elevation sections of the park are closed, including the White Wolf campground and lodge, Hetch Hetchy-area trails and the Hodgdon Meadow campground, officials said.

While more of Yosemite is expected to burn, flames had torched only about 15,000 acres of the park - or 2 percent. Most of Yosemite remains open, including heavily visited Yosemite Valley. The park can be entered through Highway 140 from Merced and Highway 41 from Fresno.

Park officials were also beefing up fire personnel at two of Yosemite's three groves of giant sequoias. Sprinklers were running and crews were digging trenches at the Merced and Tuolumne groves, to protect the trees should the fire approach.