Abstract As multiple countries share a river, the likelihood of conflicts over distributing water resources increases, particularly under the effects of climate change. In this paper, we demonstrate how countries can cooperate in sustainable transboundary water sharing under such conditions. We examine the case of water distribution in the Volta Basin of West Africa between the upstream country, Burkina Faso, and the downstream country, Ghana. The latter faces an additional tradeoff between the production of hydropower in the south, close to the outlet of the basin, and agricultural water use in the reservoir’s catchment area in the north. In the framework of a stochastic Stackelberg differential game, we show how sustainable water-sharing agreements can be achieved by linking transboundary flows to hydropower exports. Our results indicate that, through cooperation, Ghana will have an opportunity to increase its water abstraction for agriculture, which has remained largely restricted. We also find that the equilibrium strategies for the long-run distribution are stable even with increasing variances of water flow.