Officials say that residents have not taken care of the cave, leaving it unsuitable for inhabitation, and that the government should oversee the village as it is listed as a protected community by the Getu River Tourism Administration, a local agency. They have offered each resident 60,000 renminbi, or approximately $9,500, to leave.

Only five families have agreed to move.

The remaining 18 families have held on stubbornly to their homes inside the cave. They say that the new homes are too small, that they fear losing access to their land, and that they alone, because of their historical connection to the cave, should have the right to independently control its small tourism economy.

“The residents of this cave should be the administrators of tourism here, regardless of whether or not we are paid,” said Wang Qiguo, the head of the local village, who established the first hostel there.

As he spoke, his wife prepared a steaming array of dishes made from home-smoked pork and local vegetables grown in the valley.

After all, Mr. Wang noted, “The best thing about this cave is its inhabitants.”