Benefiting from historically favorable conditions (e.g. low costs, fertile land, and abundant water), pistachio producers in Rafsanjan, Iran, have flourished, with pistachio orchards and production growing dramatically since the 1970s. Today, however, the enormous increase in water consumption associated with pistachio production has severely depleted groundwater aquifers, causing widespread water shortages in the region. In this article, we develop a comprehensive system dynamics model, combining the agronomic, economic, hydrologic, and behavioral aspects to analyze the long-term implications of pistachio production. Our research contributes to the literature of agricultural water management in three significant ways: (i) it provides a validated and quantitative model exploring pistachio farming for a region; (ii) it explicitly captures behavioral decision rules associated with orchard growth and production investment; and (iii) it addresses a natural common-pool-resources problem with very long-time horizons. We consider several policies aimed at addressing the problem (e.g. water transfers, drip irrigation, financial subsidies, income tax, water pricing, and land purchasing). Our results suggest that policies that increase the effectiveness and efficiency of production (e.g. water transfer and drip irrigation respectively), albeit preferred by farmers, lead to better-before-worse results, depleting groundwater storage in the long term. Insights from the model can help policymakers have a better understanding of the unintended consequences of their policies.