NOVELTY - Producing biogas, preferably from raw materials containing starch as biomass, comprises (a) fermenting biomass in first fermentation stage which depends on dry substance content of biomass, by supplying subset of liquid fermentation substrate, (b) separating accumulated fermentation substrate into solid phase and liquid phase, and solid phase is subjected to further fermentation stage including secondary fermentation and forming an oxygen-free and sulfur-and ammonia-poor biogas, and (c) reprocessing or cleaning biogas obtained in respective stages of fermentation for producing methane.    USE - The method is useful for producing biogas.    ADVANTAGE - The method achieves an enhanced yield of raw materials and biogas, and an enhanced content of methane in the raw gas.    DETAILED DESCRIPTION - Producing biogas, preferably from raw materials containing starch as a biomass, through a multistage anaerobic conversion by wet fermentation as a primary fermentation (hydrolysis and acidogenesis) and secondary fermentation (methanogenesis and acetogenesis), in at least two separate fermentation steps operated at different conditions, comprises (a) fermenting biomass in the first fermentation stage which depends on the dry substance content of biomass, at temperatures of 40-65 degrees C, by supplying a subset of liquid fermentation substrate, derived from the previous first fermentation stage and a temperature of at least greater as the temperature of the first fermentation stage, by maintaining a dry substance content of less than 15%, preferably 12%, where heat energy is released by spontaneous multiplication of the acidophilic bacteria present in the supplied liquid fermentation substrate and are reacted in parallel to the primary fermentation using anaerobic bacteria present in the substrate containing sulfur and/or ammonia-containing compounds to sulfur and ammonia, (b) separating the accumulated fermentation substrate into a solid phase and a liquid phase, after the first fermentation stage, where the solid phase is adjusted to a higher dry matter content, and the solid phase is subjected to at least one further fermentation stage including a secondary fermentation for at least 7 days, where a pH is adjusted to above 7 and forming an oxygen-free and sulfur-and ammonia-poor biogas with a methane content of 60-85 vol.%, on the available carbon sources, and (c) separately reprocessing or cleaning the biogas obtained in the respective stages of fermentation for producing methane.    DESCRIPTION OF DRAWING(S) - The drawing shows a schematic representation of a plant for producing biogas.    First fermenter (F1)    Second fermenter (F2)    First line (L1)    Second line (L2)    First pump (P1)