Optimal recycling of minerals can be thought of as an integral part of the theory of the mine. In this paper, we consider the role that wastewater recycling plays in the optimal extraction of groundwater, a renewable resource. We develop a two-sector dynamic optimization model to solve for the optimal trajectories of groundwater extraction and water recycling. For the case of spatially increasing recycling costs, recycled water serves as a supplemental resource in transition to the steady state. For constant unit recycling cost, recycled wastewater is eventually used as a sector-specific backstop for agricultural users, while desalination supplements household groundwater in the steady state. In both cases, recycling water increases welfare by shifting demand away from the aquifer, thus delaying implementation of costly desalination. The model provides guidance on when and how much to develop resource alternatives.