In the Niger River Basin, climate change, an exploding population, and paltry infrastructure have formed a perfect storm for a new era of conflict.

West Africa’s Niger River Basin, home to some of the poorest countries in the world, might be the bleeding edge of a new kind of conflict. Along Africa’s third-largest river, climate change and ballooning populations in Mali, Niger, and Nigeria — the three largest countries that rely on the waters of the Niger River — are driving a looming resource shortage, exacerbated by strained infrastructure, that risks pushing them past the breaking point. And research shows economic deprivation and environmental degradation may have already begun to take their toll, contributing to destabilizing much of the region and potentially threatening global security.

From sharpening confrontations between farmers and herders over access to pastures and wells, to spurring the emergence of Boko Haram, the absence of water and electricity, and the depletion of scarce natural resources have already fostered swaths of poverty where extremist groups have taken hold. And in the next 15 years, the population across Mali, Niger, and Nigeria is projected to grow 75 percent, soaring to 337 million. More than half of these people will live in cities; three in every five will be under 25 years old. Crafting resilient approaches now to manage the vital resources that these people will demand — especially water and sanitation — could promote sustainable ways to absorb this boom, and help calm the unrest that has been simmering. Ignoring the rising challenge, however, is as good as courting disaster.

Delivering basic public goods and services is already a struggle for the governments of Mali, Niger, and Nigeria. Less than half the rural populations in these countries have access to clean water, and sanitation facilities are nearly non-existent. Many urban areas, too, lack formal infrastructure: Two-thirds of city dwellers have no electricity and fewer still are connected to sewer systems. Mounting demographic and environmental pressures, however, are threatening to make it even harder for these nations to meet their people’s needs, or for citizens to take care of themselves.

At the moment, the region relies mostly on its own agricultural sectors to feed and employ its expanding populations. Farming and livestock account for 21 percent of GDP, and supply 23 percent of all jobs in Nigeria, while providing 40 percent of GDP and 80 percent of jobs in Mali and Niger. But water supplies — farming’s lifeblood — are increasingly stretched; half of all water withdrawals in Nigeria, two-thirds in Niger, and 98 percent in Mali go to agriculture.

Important as agriculture is, it’s also very fragile. Rainfall in the Niger Basin is highly erratic, and river levels can correspondingly vary substantially from place to place, season to season, and year to year, yet these nations lack adequate infrastructure to effectively manage this vital resource. The basin’s few dams and reservoirs furnish only limited water storage capacity to cushion this volatility: All of Niger’s dams combined, for example, hold less than one-tenth that country’s annual water needs.

Where irrigation systems deliver reliable water supplies, farmers can realize higher output and reap more valuable harvests, using less water to greater effect. In Nigeria, irrigation has boosted rice and tomato yields by 60 percent, on average, and quadrupled sugarcane production per hectare. But across the basin, barely 6 percent of cultivated land is equipped for irrigation, leaving the vast majority of farmers dependent on the vagaries of the weather to water their fields.

Because of this lack of infrastructure, vulnerable populations across the region increasingly find themselves on a resource treadmill, pushed like Alice and the Red Queen in Through the Looking Glass to run faster and faster to remain in the same place. Without irrigation systems, small-holder and subsistence farmers struggling to keep up with demand are planting on more land more often, no longer letting the earth lie fallow to recover between harvests, and plowing under forests to sow new fields. But these remedies only serve to exhaust the soil and exacerbate deforestation and desertification, driving farmers and herders further onto ever more marginal lands.

Environmentally, this race is unsustainable. A new study by researchers at Sweden’s Lund University concludes that, on present course, the region is failing to grow enough food, feed (for livestock), and fuel (wood and charcoal are major energy sources) to keep pace with burgeoning populations, with demand more than double available supply over much of the basin says the study. Right now, the Niger Basin countries are far from closing this gap.

Climate change will all but inevitably make the situation worse. Even as water demand among the riparian countries tripled during the past 30 years, long-term precipitation trends show a 30 percent reduction in rainfall since the 1970s, and the Niger River’s flows, gauged at multiple locations along its course, have fallen by some 20 to 50 percent. Looking forward, current climate projections disagree whether annual rainfall will increase or decrease in the basin over the coming decades, but they do concur that average temperatures around the region will warm significantly. This means more crops may be lost to heat stress. Precipitation patterns will also likely grow yet more variable, threatening both deeper droughts and stronger floods.

Economically, the costs of environmental degradation are debilitating. The United Nations Environment Program (UNEP) and the United Nations Development Program (UNDP) have calculated that the annual losses from water scarcity, water-related illnesses, pollution, waste, deforestation, and desertification approach a staggering 20 percent of GDP for Mali alone. Similarly, the World Bank figures the annual costs of environmental degradation in Nigeria at 5 to 10 percent of GDP.

This pattern becomes problematic as long-established methods for adapting to natural variability stop being viable. Rural populations throughout the region have traditionally responded to changing resource availabilities by migrating — farmers move to find new fields, herders driving their livestock to greener grasslands. But rising populations and environmental stresses are coming to constrain such adaptive strategies. In recent decades, rainfall patterns across the Niger Basin have shifted southward, pushing nomadic and semi-nomadic herders southward too, into agricultural lands cultivated by sedentary farmers. As crowding around wells, watering holes, and riverbanks has intensified, clashes over access to land and water often overwhelm the traditional agreements — such as the practice in which herders grazed their animals on fields after the harvest — that previously prevailed. Although such frictions remain localized in scale, they have become increasingly widespread. One survey of northern Nigeria found that resource competition, principally over land and water, figured as the primary cause in 54 percent of conflicts between households or communities. The confrontations have become more violent as well. In central Nigeria alone, according to Human Rights Watch, farmer-herder conflicts killed more than 1,000 people just in the opening months of 2014.

Environmental pressures and resource scarcity also seem to be playing a part in more widespread insecurity. The causes of civil conflict and violent radicalism are multiple and complex, but militancy can more readily take root among disaffected communities laboring against dwindling resources and a dearth of economic opportunities.

Thus, in 2013, crisis gripped Mali as Islamic terrorist groups associated with al Qaeda took over the north of the country. These radical Islamist factions were able to seize control of much of the nation’s territory by exploiting a pre-existing revolt among the region’s Tuareg peoples, first absorbing and then displacing the Tuareg insurgent forces. Crucially, this long-standing Tuareg rebellion first arose in part from the perceived indifference or inability of distant central government to provide relief to Tuareg regions plagued by sustained drought in the 1970s and 1980s. Bamako eventually dampened this initial rebellion with formal peace negotiations and promises of development, but assistance proved slow and the north remained marginalized, while Tuareg grievances continued and the insurgency ultimately returned.

In neighboring Nigeria, many observers such as the International Crisis Group link the rise of Boko Haram to the decline of the once-dominant agricultural sector in Nigeria’s impoverished northern states and popular frustrations at government failures to deliver water, energy, roads, and other services. With faltering agriculture and feeble infrastructure hobbling the northern economy, poverty and unemployment have rendered the region’s youth more vulnerable to Islamic radicalization and Boko Haram recruitment. Worse, the instability in Nigeria has now come full circle, threatening to deepen the cycle of insecurity as violence in the northern states further depresses agricultural production, disrupting harvests and displacing farmers fleeing the fighting.

Further south, Nigeria’s oil-rich Niger Delta has also witnessed significant environmental conflict. Ethnic rebel groups such as the Movement for the Emancipation of the Niger Delta long cited the chronic pollution of their communities’ land and water among the grievances motivating their attacks on petroleum operations and guerrilla warfare against the Nigerian state.

So what can the Niger Basin nations do? Better water management would make a good place to start. Drip irrigation schemes that deliver water directly to crop roots would slash agricultural water requirements while enhancing yields. Increased access to safe water supplies and improved sanitation would decrease water-borne diseases and reduce the time spent gathering water — time taken away from school or work. Small-scale hydropower installations could provide electricity to unserved populations. Such projects would boost local economies directly, creating jobs laying irrigation canals and power lines.

Building better infrastructure also lays a foundation for future growth. Given dependable power, businesses can stay open at night. Given consistent water supplies, farmers can plant new fields. According to the World Bank, for instance, irrigation projects in Niger and Nigeria could generate $20 to $40 in benefits for every dollar invested. As importantly, building better infrastructure could help build stronger societies, demonstrating engagement and commitment in communities where governments have been viewed as ineffective, absent, or even adversarial.

Governments and local communities, international aid agencies, and the private sector all have roles to play and must work together to deploy such development strategies. National authorities and local stakeholders will have to cooperate to identify local needs and implement responsive planning. Past infrastructure programs have often been frustrated by failures to coordinate, as when Nigeria embarked on a wave of dam construction in the 1990s, but built many with no accompanying irrigation works or sited away from adequate irrigable land.

To be sure, the infrastructure needs are substantial in all of the states along the Niger River and the funding gaps are sizable. Nevertheless, a lot can be accomplished through local and small-scale initiatives. Farmer or community-owned and operated projects are often better accepted (and better maintained) by the beneficiaries than large-scale schemes. They are also often less expensive, and amenable to alternate sources of financing and lower-cost technologies. Indeed, a World Bank analysis of Niger reckons the country’s infrastructure funding gap could be cut in half by relying on alternative financing from the private sector and low-tech solutions to water supply like installing public taps and wells, even while expanding irrigation by 11,000 square kilometers.

Beyond the Niger Basin, many other basins similarly confront increasing environmental pressures and political conflicts, from the Indus to the Tigris-Euphrates, where the murderous Islamic State expressly vaunts bringing improved water and power to Raqqa, its self-proclaimed capital in Syria. Forging resilient infrastructure and resource strategies in West Africa could offer insights that could be applied in other unstable regions.

These countries recognize that they face pressing challenges in the form of socioeconomic change, resource stress, and violent extremism. Indeed, the Plan for the Sustainable Recovery of Mali put forward by the government and the international community after the 2013 crisis explicitly targets these interwoven concerns. But the basin states can no longer afford only to react once disaster strikes. They must plan ahead to ensure the future.

As a Tuareg proverb teaches, “One must sink wells today to quench tomorrow’s thirst.” It’s time to start digging.