Afghan farmer Niamatullah survived nearly two decades of conflict, growing beans, wheat and corn in Helmand province as war raged around him. When he finally decided to uproot his family and flee last month, it was because of the weather.

One of the worst droughts in decades in Afghanistan parched the fields of the 38-year-old, who goes by a single name, leaving his crops withered and worthless. He felt he had no choice but to pack his 15-member extended family into a rented truck and head out to search for day labor somewhere less desperate.

“Our children are crying because there is nothing to eat,” Niamatullah said.

This year’s deep drought is compounding the economic crisis that deepened when the Taliban overthrew the previous Afghan government, prompting the U.S. and others to freeze some $9 billion in Afghan central-bank assets and spurring a large number of the country’s professionals to leave.

Now the scarcity of water is slashing farmers’ incomes and driving up food bills for people in cities. The United Nations estimates that the drought is threatening the livelihood of up to 9 million Afghans and affecting 25 of the country’s 34 provinces.

Tough conditions have already put 14 million people—more than one-third of the Afghan population—in a food-security crisis, according to the U.N. Food and Agriculture Organization. Afghanistan’s current harvest is expected to be 15% below average due to the drought, the FAO said.

“This is the worst drought in 35-36 years,” said Richard Trenchard, the country director for FAO in Afghanistan. “Many public institutions, which provide a public safety net, have ceased to function,” after the Taliban takeover, he said. “Farmers have very little to fall back on.”

Afghanistan is heavily reliant on livelihoods sensitive to fluctuations in weather, such as rain-fed agriculture and cattle farming. Impoverished villagers often lack the capital and technology to switch to more modern and resilient farming methods. Climate change stands to increase the burden.

Around 12% of Afghanistan’s land is suitable for agriculture, but around 80% of the population relies on farming for survival, said Samim Hoshmand, a former top climate negotiator under Afghanistan’s National Environment Protection Agency.

“If the drought continues, and political instability continues, the future will be a disaster,” Mr. Hoshmand said.

Afghanistan’s new Taliban government has so far presented no plan for how to create jobs or provide support for a population that is sinking deeper into poverty. Anger over economic hardship could boil over into unrest, Afghan farmers said.

“We will wait for six months. If things don’t get better, we will stand against the Taliban,” said Mohammad Amir, a 45-year-old farmer from Dasht-e-Top, an arid plain in Wardak province west of Kabul. The area used to be famous for its sweet, crisp apples—but has dried up. A wide riverbed running along the highway bears no trace of water. Farmers say they haven’t seen snow in 20 years.