In intensive breeding farms, maintaining an adequate indoor thermal environment and air quality is crucial in order to establish healthy conditions and increase productivity. In the EU, fossil fuels and electricity are the main energy sources adopted for this purpose, yet introducing renewable energy sources and efficient Heating Ventilating Air Conditioning systems would reduce energy consumption and improve sustainability.Another environmental concern in agricultural production is related to the intensive use of fertilizers, causing nitrate contamination in surface water and groundwater. Therefore, innovative strategies to reduce fertilizers and simultaneously reduce primary energy consumption are worthy of investigation.This paper addresses both issues, studying the application of geothermal heat pumps in the agro-zootechnical sector, where they are rarely applied and thus their potential needs to be verified. The study considers systems based on the closed loop configuration, i.e. Ground Source Heat Pumps (GSHP), and on the open loop configuration, i.e. Groundwater Heat Pumps (GWHP).Firstly, a pilot GSHP system for a piglet stable in Northern Italy is presented. Thanks to the use of both ground source and thermal recovery of air ventilation, the system achieves an appreciable reduction in both primary energy consumption and running costs, compared with a more traditional system typically adopted in this kind of farm.Secondly, the feasibility of an innovative concept of a GWHP combined with the irrigation system is studied through numerical modelling. The area of the piglet stable is represented in a flow and heat transport model; groundwater used by the heat pump is re-injected up-gradient during the cold season, while it is used for irrigation during the warm season. The system would provide energy-efficient climatization to the farm stables and, at the same time, promote the reuse of nitrogen in cultivated fields as a result of groundwater recirculation through irrigation.