A massive blaze that has blackened a huge area in the northern California forests started from an illegal campfire a hunter built and let grow out of control.

The so-called Rim Fire, now the fourth-largest blaze in California on record, erupted nearly three weeks ago in the Stanislaus National Forest west of Yosemite National Park.

The campfire was built in defiance of Forest Service restrictions imposed at the time due to dangerously hot, dry conditions in the area.

The precise origins of the blaze remain under investigation and no arrests have been made, the US Forest Service said.

Whether the hunter deemed to be the culprit will face criminal charges depends on a variety of factors, including the degree of carelessness or neglect determined by investigators, Forest Service spokesman Ray Mooney said.

Beyond saying the fire began "when a hunter allowed an illegal fire to escape", authorities declined to comment on evidence linking the hunter to the blaze.

The individual has not been publicly identified.

The Rim Fire, named for a popular local lookout spot called Rim of the World, has charred more than 237,000 acres or 958sq.km of timber and scrubland since it erupted on 17 August in an area known as Jawbone Ridge in a remote corner of the national forest.

Firefighting costs there have run to $81m (€62m) to date, with about 5,000 personnel assigned to battle the blaze at its peak.

The blaze ranks as the largest of dozens of wildfires that have raged across several states in the drought-parched west this year, straining US firefighting resources.

Dozens of homes and cabins near Yosemite have been destroyed and nearly 2,500 dwellings in the region are still threatened by the blaze.

No serious injuries have been reported, and most evacuation orders have been lifted as firefighters tightened their grip on the flames.

As of yesterday, ground crews armed with hand tools and chainsaws, and backed by bulldozers, water-dropping helicopters and aeroplane tankers with payloads of chemical retardant, had cut containment lines around 80% of the fire's perimeter.

Fire managers say they expect the blaze to continue burning for several more weeks, and warned that a resumption of gusty winds "could challenge containment lines".

Less than a third of the total burned acreage lies inside Yosemite, and firefighters there have succeeded in limiting most of the damage to wilderness and back-country areas in the park's remote northwestern corner.

Several campgrounds, numerous trails and one of the four main entrances to the park have been closed by the fire.

But the most popular portions have remained open to the public, including the scenic Yosemite Valley area famed for its towering granite rock formations, waterfalls and meadows.

Nevertheless, park officials say droves of visitors who typically crowd Yosemite in late summer have noticeably diminished.

Yosemite-area businesses say the region's tourist economy has been hit hard a year after an outbreak of hantavirus in the park frightened away many park visitors.

Word that investigators had traced the fire's origins to a hunter's campfire came a day after authorities ruled out the possibility that the Rim Fire somehow began from an illegal marijuana cultivation site in the national forest.

Speculation that a pot farm might be to blame grew out of videotaped comments made by a local fire department chief during a 23 August community meeting, but fire officials again denied any such connection to the blaze, or to the hunter in question.

"There is no indication the hunter was involved with illegal marijuana cultivation on public lands and no marijuana cultivation sites were located near the origin of the fire," the Forest Service said in its statement.