Twenty-seven wildfires are burning out of control in the western U.S. state of California, threatening thousands of homes and forcing evacuations.

California's Department of Forestry says more than 12,000 firefighters are battling the blazes. Almost 4,000 are working on the so-called Telegraph fire, which has burned almost 13,000 hectares in the mountains just outside Yosemite National Park since Friday.

Power lines, water systems and thousands of homes are endangered by the flames. The blaze forced officials to temporarily close a main highway, Highway 140, into Yosemite National Park, a popular international tourist destination.

The park is open, although the fire has caused some facilities to lose electricity, and some visitors have decided to leave because of the smoke.

Officials say a person apparently started the Telegraph fire on Friday with a spark from target shooting. Firefighters say the blaze is behaving erratically because the area has not burned in the past 100 years.

More than 2,000 wildland fires have burned in California since June. Most of them have been contained.