MARIPOSA, Calif. (Reuters) - A wildfire that has forced thousands of Californians to flee their homes exploded in size on Wednesday, threatening a picturesque gold rush town outside Yosemite National Park as dozens of blazes scorched the U.S. West.

More than 2,000 firefighters have contained just 7 percent of the Detwiler Fire, which is approaching the town of Mariposa and tiny communities in the foothills of the Sierra Nevada mountains, the Cal Fire state agency said on its website.

The blaze has mushroomed to 48,000 acres (19,424 hectares), an increase of about 23,000 acres (9,307 hectares) compared with the day before. The fire has destroyed 29 structures and is threatening some 1,500 more structures, local media reported.

Firefighters are facing “extreme and aggressive fire behavior” with solid walls of flame and sparks from the main blaze setting spot fires in grasslands, the California Department of Forestry and Fire Protection (Cal Fire) said.

Flames have destroyed eight structures southwest of Yosemite National Park and the fire is threatening power lines to the park, but no one has been injured, Cal Fire said.

The small communities of Coulterville and Greeley Hill were ordered evacuated on Wednesday.

Mariposa’s 2,000 residents were told to leave town on Tuesday after its power and water links were damaged. In total, nearly 5,000 people are under orders to vacate their homes, officials said.

Slideshow ( 17 images )

Many summer vacationers visit Mariposa, which is largely dependent on tourism.

The town, taking its name from the Spanish word for butterfly, was founded during the California gold rush in the 19th century and is surrounded by pine-covered hillsides. It boasts the state’s oldest law court, built in 1854 in a Greek Revival style and topped with a clock tower.

The town’s hospital, called the John C. Fremont Healthcare District, and its 14 patients did not evacuate, at the advice of fire officials, said the facility’s interim CEO Matthew Matthiessen.

Moving the mostly elderly patients could endanger their health, he added. “If we can keep them here and limit that stress and they’re safe, then that’s what we’re going to do.”

The California blaze was among 37 active large fires spread across 12 western states as of Wednesday, according to the National Interagency Fire Center’s website.

Governor Jerry Brown declared a state of emergency for Mariposa County on Tuesday, dispatching resources to the area.