The biomass produced in activated sludge tanks and clarifying tanks is stabilized in the digestion tower and used to produce biogas. Thorough mixing of the sludge increases the gas yield and reduces its retention time in the reactor. In the process, the gas is withdrawn from the upper part of the digestion tower, compressed in the liquid ring compressor, and reintroduced through the nozzles at the bottom.