An apparatus for performing a process for treating liquid waste comprising organic components that contain nitrogen and phosphorus for the production of fertilizers, wherein nitrogen is contained in the form of an organic nitrogen compound, which is converted to nitrate, and during such conversion the waste is contacted with a basic solid, whereby the pH of the waste is maintained in a weakly alkaline, neutral or acidic range, wherein nitrogen and phosphorus are removed from the waste separately, said apparatus comprising: - at least one housing with an elongated space - at least one inlet opening at one end of the housing for charging the liquid waste, - at least one outlet opening at the end of the housing opposite the inlet opening , - retention means in the interior of the housing for dividing the space in the interior of the housing into compartments, - at least one first filling material and at least one second filling material different therefrom, which are present in the interior of housing and are retained at a provided position by the retention means , wherein said at least one first filling material is a porous filling material, at the surface of which microorganisms may populate, which aerobically degrade nitrogen and optionally phosphorus from the liquid waste, and said at least one second filling material is a basic solid, which is a carbonate or a hydrogencarbonate with alkali metals or alkaline earth metals as counter-ions, - at least one opening at the longitudinal side of the housing , through which filling material can be charged into the interior of the housing, - a supply tank , in which the liquid waste arrives through the outlet opening , wherein said supply tank has at least one first outlet and at least one second outlet , wherein a liquid phase containing the nitrate can be removed through the first outlet , and a solid phase containing phosphate as a phosphate salt can be removed through the second outlet , from the supply tank , and - a pump within said supply tank, wherein said housing is not immersed into said supply tank , so that the liquid waste can be pumped back towards the inlet opening in a cycle. - at least one housing with an elongated space - at least one inlet opening at one end of the housing for charging the liquid waste, - at least one outlet opening at the end of the housing opposite the inlet opening , - retention means in the interior of the housing for dividing the space in the interior of the housing into compartments, - at least one first filling material and at least one second filling material different therefrom, which are present in the interior of housing and are retained at a provided position by the retention means , wherein said at least one first filling material is a porous filling material, at the surface of which microorganisms may populate, which aerobically degrade nitrogen and optionally phosphorus from the liquid waste, and said at least one second filling material is a basic solid, which is a carbonate or a hydrogencarbonate with alkali metals or alkaline earth metals as counter-ions, - at least one opening at the longitudinal side of the housing , through which filling material can be charged into the interior of the housing, - a supply tank , in which the liquid waste arrives through the outlet opening , wherein said supply tank has at least one first outlet and at least one second outlet , wherein a liquid phase containing the nitrate can be removed through the first outlet , and a solid phase containing phosphate as a phosphate salt can be removed through the second outlet , from the supply tank , and - a pump within said supply tank, <EOS>