TECHNOLOGY FOCUS - INORGANIC CHEMISTRY - Preferred Method: In the method: the phosphorus is recovered by precipitation with at least one of a calcium salt, a ferrous salt, a ferric salt or an aluminum salt; the nitrogen is recovered by adjusting the pH of the aqueous phase to 8-11 by using at least one of calcium oxide, calcium hydroxide and calcium carbonate, heating the pH adjusted aqueous phase at 40-100 degrees C, preferably 80-100 degrees C to produce ammonia gas, and collecting the ammonia gas by using stripping tower; and the ammonia gas is converted into ammonium sulfate, ammonium nitrate or urea. The method (II) further comprises: pre-treating the feedstock prior to heating to the first temperature by heating the feedstock to a pretreatment temperature of 80-220 degrees C for 5-60 minutes to produce a pretreated feedstock; and removing water from the pretreated feedstock and treating the water to recover nitrogen and phosphorus. In the method (II), nitrogen and phosphorus are recovered by adjusting the pH of the water to 8-11 with at least one of calcium oxide, calcium hydroxide and calcium carbonate to precipitate phosphorus, separating the precipitate, heating the pH adjusted water to 40-100 degrees C to produce ammonia gas and collecting the ammonia gas. Preferred Components: The calcium salt is at least one of calcium oxide, calcium hydroxide or calcium carbonate. The ferric salt is ferric chloride. The aluminum salt is aluminum sulfate. EXAMPLE - Nannochloropsis algae were harvested by centrifugation to obtain algal paste (comprising moisture content (79 wt.%), ash free dry weight (17%) and ash content (4%)). The paste (400 g) was treated hydrothermally by placing in a Parr reactor (600 ml). The reactor was ramped from room temperature to 260 degrees C for 30 minutes and then cooled to room temperature for 30 minutes. Sulfuric acid (16.4 wt.%) was added to the algal paste and pH was adjusted. The acidified material was heated to 60 degrees C for 30 minutes. Heptane was added to obtain a solvent extraction composition and was heated to 70 degrees C for 30 minutes with constant mixing. After 30 minutes, the composition was allowed to phase separate at room temperature. The organic phase was decanted. The solvent was removed from the organic phase to obtain oil. The aqueous phase was extracted for second time and was filtered to recover insoluble solids (comprising nitrogen (3.22 wt.%) and phosphorus (973 ppm) at pH of 6).