Crews contending with triple-digit temperatures slowed the spread of an aggressive wildfire that destroyed dozens of homes in a rural area of California near Yosemite National Park, officials said Sunday.

The blaze has burned for a week and has scorched more than 119 square miles of dense brush and dead trees in the Sierra Nevada foothills. Many residents who were evacuated were allowed to return, but flames continue to threaten about 1,500 homes in Mariposa County.

The fire was 45 percent contained, but officials said it could take two more weeks to fully surround it.

“They are still out in front of an uncontrolled fire, but the fire isn’t moving at 30 mph. The fire is crawling along,” fire spokesman Brandon Vaccaro said Saturday.

Flames spared Mariposa, a historic Gold Rush-era town, but more than 130 buildings, including 63 homes, were destroyed.

More than 5,000 firefighters fought the blaze using air tankers, helicopters and bulldozers.

The fire grew by up to 47 square miles a day at its peak. But by the weekend, the growth rate was slowed despite dry, blistering weather, Vaccaro said.