Predictions show that pressure on already limited water and energy resources is expected to increase in many parts of the world as a result of growing populations, rapid urbanization, increasing pollution and climate change impacts. With water and energy playing a critical role in socioeconomic development, ensuring resource security is a top policy concern. However, achieving this efficiently requires taking into account the various links between the two sectors through their joint management. Feedback between the water and energy sectors exists across system life-cycles and links the resources both spatially and temporally. Tracking the impacts of policies made in one sector on the other can thus be complicated and several 'nexus' methodologies have been developed to try and address these issues. However, the different physical, temporal and spatial characteristics of the water and energy systems present several hurdles in analyzing the two resources simultaneously. This paper overcomes many of these problems with a new, fully coupled waterenergy optimization model. Based on a review of contemporary literature, the model develops an original methodology to hard-link the two systems in detail across spatial and temporal scales, as well as between individual system processes throughout the life-cycle of each resource. In addition, the model also tracks changes in water quality through each process, allowing for detailed accounting of the energy needs for water treatment. The methodology proposed in this paper can be used to investigate various cross-sectoral issues and policies such as: water availability and temperature impacts on power plant cooling; emission constraint and biofuel expansion planning impacts on water resources; and the implications of water infrastructure expansion on the energy system. The capabilities of the coupled model are investigated in an example case study for Spain. An integrated approach is shown to have several benefits including lower total costs, better resource efficiency and improved robustness for a wide range of variations in several uncertain parameters. Coupled water-energy planning thus provides a critical opportunity to improve resource security and prevent inefficient decisions which could exacerbate problems even further.