A process for the treatment of porcine excrement, to transform it into fertilizer. To a liquid solution of porcine excrement, a solution of phosphorus pentoxide and potassium oxide is added in suitable proportions to obtain in the final product the desired ratio between nitrogen, phosphorus and potassium, and as a function of the nature of the soil and of the type of application, after which the obtained solution is mixed with a product adapted to retain water, having the desired shape of the final product, so as to obtain a shaped and conditioned fertilizer, which is subjected to a drying treatment. Preferably, the water-retentive product is in the form of granules of polyacrylamide, which swell in water to a number of times their size when dry. The granules absorb the liquid very quickly but release it only slowly, so that they can swell and dry over and over and so have a long effective life.