Process for treating solid waste containing an organic fraction, comprising an initial step of extrusion pressing the waste with production of a solid fraction and a liquor, characterized in that: a) said solid fraction is subjected to a milling treatment at a pressure lower than the atmospheric pressure in a rotary mill that causes said solid fraction to heat from a room temperature to a sanitization temperature of from 55 to 160°C, said temperature being adjusted by controlled evaporation of water present in or introduced into said solid fraction, said milling treatment at a pressure lower than the atmospheric pressure producing a sanitized dry solid and water; b) said liquor is combined to said water produced in said milling treatment of said step a) and is subjected to a treatment of anaerobic digestion in three subsequent steps, comprising a first step of mesophilic fermentation at a temperature from 35 to 45°C, a second step at a temperature from 65 to 90°C, in which a pasteurization treatment is carried out, and a third step of thermophilic fermentation at a temperature from 50 to 60°C, said treatment of anaerobic digestion producing biogas and a digestate comprising a solid component dispersed in water; c) said digestate is subjected to an evaporation treatment of said water under vacuum in one or more steps, thereby producing a concentrated compost and steam which is condensed with formation of water which is in part used in other steps of the process and in part made available to be reused in the civil or agricultural or industrial field; wherein said sanitized dry solid produced in said step a) and said biogas produced in said step b) are suitable to be used as fuel to produce thermal and electric energy to be used in said process, and said compost produced in said step c) is suitable to be used as fertilizer or improver in agriculture or added to said solid fraction in said step a). a) said solid fraction is subjected to a milling treatment at a pressure lower than the atmospheric pressure in a rotary mill that causes said solid fraction to heat from a room temperature to a sanitization temperature of from 55 to 160°C, said temperature being adjusted by controlled evaporation of water present in or introduced into said solid fraction, said milling treatment at a pressure lower than the atmospheric pressure producing a sanitized dry solid and water; b) said liquor is combined to said water produced in said milling treatment of said step a) and is subjected to a treatment of anaerobic digestion in three subsequent steps, comprising a first step of mesophilic fermentation at a temperature from 35 to 45°C, a second step at a temperature from 65 to 90°C, in which a pasteurization treatment is carried out, and a third step of thermophilic fermentation at a temperature from 50 to 60°C, said treatment of anaerobic digestion producing biogas and a digestate comprising a solid component dispersed in water; c) said digestate is subjected to an evaporation treatment of said water under vacuum in one or more steps, thereby producing a concentrated compost and steam which is condensed with formation of water which is in part used in other steps of the process and in part made available to be reused in the civil or agricultural or industrial field;