MAZAR-I-SHARIF, Afghanistan — More than two dozen villagers panning for gold in the northern Afghan province of Badakhshan were killed on Sunday after the makeshift tunnels where they were working collapsed following heavy snowfall, officials said.

Muhammad Rustam Raghi, the governor of Kohistan district, said that police officers and villagers had pulled out 30 dead as well as seven wounded, and that the rescue efforts were continuing.

Mr. Raghi said that about 10,000 people pan for gold along the river, often illegally digging tunnels as deep as 50 feet with simple machinery and then searching for gold with pans for about $7 a day.

Afghanistan is believed to have vast mineral wealth, but continuing violence, a lack of strong state institutions and widespread corruption have meant that the sector contributes little to the country’s economy, which is still largely dependent on foreign donors.