Mineral phosphorus (P) used to fertilise crops is derived from phosphate rock, which is a finite resource. Preventing and recycling mineral P waste in the food system, therefore, are essential to sustain future food security and long-term availability of mineral P. The aim of our modelling exercise was to assess the potential of preventing and recycling P waste in a food system, in order to reduce the dependency on phosphate rock. To this end, we modelled a hypothetical food system designed to produce sufficient food for a fixed population with a minimum input requirement of mineral P. This model included representative crop and animal production systems, and was parameterised using data from the Netherlands. We assumed no import or export of feed and food. We furthermore assumed small P soil losses and no net P accumulation in soils, which is typical for northwest European conditions. We first assessed the minimum P requirement in a baseline situation, that is 42% of crop waste is recycled, and humans derived 60% of their dietary protein from animals (PA). Results showed that about 60% of the P waste in this food system resulted from wasting P in human excreta. We subsequently evaluated P input for alternative situations to assess the (combined) effect of: (1) preventing waste of crop and animal products, (2) fully recycling waste of crop products, (3) fully recycling waste of animal products and (4) fully recycling human excreta and industrial processing water. Recycling of human excreta showed most potential to reduce P waste from the food system, followed by prevention and finally recycling of agricultural waste. Fully recycling P could reduce mineral P input by 90%. Finally, for each situation, we studied the impact of consumption of PA in the human diet from 0% to 80%. The optimal amount of animal protein in the diet depended on whether P waste from animal products was prevented or fully recycled: if it was, then a small amount of animal protein in the human diet resulted in the most sustainable use of P; but if it was not, then the most sustainable use of P would result from a complete absence of animal protein in the human diet. Our results apply to our hypothetical situation. The principles included in our model however, also hold for food systems with, for example, different climatic and soil conditions, farming practices, representative types of crops and animals and population densities.