One of the largest wildfires in California history has moved deeper into Yosemite National Park.

Fire officials said flames on the opposite side of the sprawling blaze have crept closer towards thousands of homes outside the park.

The blaze burned to within less than 2km of a reservoir that serves as the primary water supply for San Francisco and surrounding communities 320km to the west, dropping some ash onto the surface of the artificial lake.

But officials said testing of samples taken from the Hetch Hetchy Reservoir show that water quality remains healthy.

If the water should become fouled by too much ash and soot and require filtration, it can be diverted through a treatment plant near San Francisco before being delivered to customers, they said.

Meanwhile, a firefighting force of around 3,700 personnel, backed by teams of bulldozers and water-dropping helicopters, continued to make headway in their drive to encircle and suppress the flames.

By late last night, containment lines had been established around 20% of the fire's perimeter, nearly triple Sunday's figure, though the overall footprint of the blaze continued to grow.

"We are making progress," Daniel Berlant, a spokesman for the California Department of Forestry and Fire Protection, said today, adding that fire managers were looking forward to a cooling trend forecast for the end of the week.

"That would bring some much-needed relief," he said.

The blaze was among the fastest-moving of dozens of large wildfires raging across the drought-parched area of the western US.

The fires have strained resources and prompted fire managers to open talks with Pentagon commanders and Canadian officials about possible reinforcements.

Buffer zones in place around homes

The Rim Fire has charred nearly 180,000 acres (74,843 hectares) - an area larger than the land mass of Chicago - since it erupted on 17 August, most of that in the Stanislaus National Forest west of Yosemite, Mr Berlant said.

It ranks as the largest California wildfire since October 2007, when the Witch Fire torched nearly 198,000 acres and more than 1,600 structures in San Diego County, and one of the ten biggest in state history, according to CalFire records.

Firefighters hacking through dense, dry brush and trees to create clearings in the rugged terrain rushed to shore up buffer zones around some 4,500 homes threatened by the blaze on its northeastern flank, Mr Berlant said.

Most of those dwellings have been ordered evacuated or were under advisories urging residents to leave voluntarily or be ready to flee at a moment's notice.

The fire already has destroyed dozens of homes and cabins, Mr Berlant said, but no serious injuries have been reported.

As of Sunday night, the opposite side of the blaze had burned 22,000 acres of Yosemite, forcing the closure of some camp grounds in the northern part of the park and the main entrance road from the San Francisco Bay area.

Two famous stands of giant sequoia trees, the Merced Grove and the Tuolomune Grove, were in the path of advancing flames and have been shut down for several days.

But the vast majority of the park, including the Yosemite Valley area renowned for its towering rock formations, waterfalls, meadows and pine forests, remained open to the public.

The Rim Fire, named for a Stanislaus National Forest lookout point called Rim of the World, has already damaged two of the three hydropower generating stations linked to the Hetch Hetchy Reservoir that supply electricity for all of San Francisco's public facilities, such as hospitals and firehouses.

But the city has been drawing on reserve power stored for emergencies and purchasing additional electricity on the open market to make up for the difference.

The cause of the blaze remains under investigation.