Campsites and lodges emptied out after disappointed tourists were ordered to leave the heart of Yosemite National Park by noon on Wednesday, as fire-fighters battled to contain a huge wildfire.

The blaze to the west of the park threatened Yosemite’s forest and sent up smoke that obscured grand vistas of waterfalls and sheer granite faces.

Yosemite Valley will be closed until at least the beginning of next week, along with a winding, mountainous, 20 mile (32km) stretch of California's State Route 41 that leads in, park spokesman Scott Gediman said.

At least 1,000 campground and hotel bookings will be cancelled — to say nothing of the impact on day visitors, park workers and small businesses along the highway, Mr Gediman said. Rangers went to campsites one at a time to inform visitors of the closures. Hotel guests got phone calls and notes on their doors.

"This is the prime visitor season, so this wasn't an easy decision to make," Mr Gediman said. "This was purely for safety's sake."

Officials were quick to point out that Yosemite was not under imminent danger from the Ferguson Fire. Authorities decided on the closure to allow crews to perform protective measures such as burning away brush along roadways without having to deal with traffic in the park that welcomes four million visitors annually.

The last time the 7.5-mile long (12km long) valley was closed because of fire was 1990, he said.

Yosemite Valley is the centrepiece of the visitor experience, offering views of landmarks such as Half Dome, Sentinel Dome, Bridal Veil Fall, El Capitan and Yosemite Falls. The glacial valley has been enveloped by a choking haze of smoke from the Ferguson Fire.

Visitors are advised to "limit activity during the periods of poor air quality," the park said in a statement. "Some facilities and services are closed or diminished."

Over nearly two weeks, flames have churned through more than 57 square miles (148 square kilometres) of timber in steep terrain of the Sierra Nevada just west of the park.

Mandatory evacuations are in place in several communities while others have been told to get ready to leave if necessary.

More than 3,300 fire-fighters are working on the fire, aided by 16 helicopters. One fire-fighter was killed on July 14, and six others have been injured.

Rhonda Salisbury, CEO of Visit Yosemite/Madera County, said the regional visitors bureau has been relocating tourists state-wide following the closure.

"People are heartbroken," she said. "Some want to ride it out for a few days and see if they can get back in the park." Others want help finding places to stay away from Yosemite.

Mr Gediman suggested valley visitors divert to Tuolumne Meadows, on Yosemite's northern edge, or to Sequoia and Kings Canyon National Parks to the south.

"There are wonderful places to visit in the region, so we're asking people to consider alternative plans," he said.

In the state's far north, a nearly 4-square-mile (10-square-kilometer) wildfire has forced the evacuation of French Gulch, a small Shasta County community that dates to the Gold Rush.