MIDDLETOWN, Calif. — Justin Galvan was out on the fire line trying to hem in a ravenous mountain blaze on the western flank of the Sierra Nevada when he got a distress call from home, 150 miles away. A wildfire had exploded in the mountains above his hometown. It had swallowed his parents’ house, and was barreling toward his own.

For years, fire has shaped the lives of Mr. Galvan and scores of other firefighters who live, work and retire in this middle-class town. Mr. Galvan was a 19-year-old looking for work when he got a seasonal job fighting wildfires, and slowly worked his way to full-time engineer, then captain overseeing a small crew of firefighting prison inmates. When the drought-dry hills ignited, he and other firefighters from the area would race away to try to save somebody else’s home.

But this time, many of the people touched by the fire are themselves firefighters. At least eight of the 585 homes destroyed in the Valley Fire here belonged to firefighters, and others lost cars or garages or had some property damage. Their families fled with the rest of the evacuees, to relatives’ homes or emergency shelters.

On Tuesday, as a handful of residents began trickling back to check on their homes, businesses and livestock, Mr. Galvan and four other firefighters waded through his burned bedroom, searching for anything that remained. Like gold miners sifting for treasure, they dumped buckets of char onto a latticed patio table and shook the ash through. Here was a penny. There was some jewelry.